@elyra/canvas 12.31.2 → 12.32.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 (121) hide show
  1. package/dist/{_baseForOwn-721741a9.js → _baseForOwn-2ef49e2c.js} +2 -2
  2. package/dist/{_baseForOwn-721741a9.js.map → _baseForOwn-2ef49e2c.js.map} +1 -1
  3. package/dist/canvas-constants-0b396113.js +2 -0
  4. package/dist/{canvas-constants-187a30d5.js.map → canvas-constants-0b396113.js.map} +1 -1
  5. package/dist/{canvas-constants-5fb4e9b8.js → canvas-constants-903046ab.js} +2 -2
  6. package/dist/{canvas-constants-5fb4e9b8.js.map → canvas-constants-903046ab.js.map} +1 -1
  7. package/dist/canvas-controller-293520d1.js +2 -0
  8. package/dist/canvas-controller-293520d1.js.map +1 -0
  9. package/dist/canvas-controller-978f3e99.js +2 -0
  10. package/dist/canvas-controller-978f3e99.js.map +1 -0
  11. package/dist/common-canvas-b19904f0.js +2 -0
  12. package/dist/common-canvas-b19904f0.js.map +1 -0
  13. package/dist/common-canvas-ef3c716f.js +2 -0
  14. package/dist/common-canvas-ef3c716f.js.map +1 -0
  15. package/dist/common-canvas.es.js +1 -1
  16. package/dist/common-canvas.js +1 -1
  17. package/dist/common-properties-7863aacb.js +2 -0
  18. package/dist/common-properties-7863aacb.js.map +1 -0
  19. package/dist/common-properties-8b8a659b.js +2 -0
  20. package/dist/common-properties-8b8a659b.js.map +1 -0
  21. package/dist/context-menu-wrapper-5846a20e.js +2 -0
  22. package/dist/context-menu-wrapper-5846a20e.js.map +1 -0
  23. package/dist/context-menu-wrapper-ac5e8c7a.js +2 -0
  24. package/dist/context-menu-wrapper-ac5e8c7a.js.map +1 -0
  25. package/dist/datarecord-metadata-v3-schema-64329ae4.js +2 -0
  26. package/dist/datarecord-metadata-v3-schema-64329ae4.js.map +1 -0
  27. package/dist/datarecord-metadata-v3-schema-cd1871c0.js +2 -0
  28. package/dist/datarecord-metadata-v3-schema-cd1871c0.js.map +1 -0
  29. package/dist/{flexible-table-9e66f95d.js → flexible-table-865cd1c7.js} +2 -2
  30. package/dist/{flexible-table-9e66f95d.js.map → flexible-table-865cd1c7.js.map} +1 -1
  31. package/dist/{flexible-table-2dc48a79.js → flexible-table-ccced653.js} +2 -2
  32. package/dist/{flexible-table-2dc48a79.js.map → flexible-table-ccced653.js.map} +1 -1
  33. package/dist/{icon-111fe072.js → icon-5f3da14a.js} +2 -2
  34. package/dist/{icon-111fe072.js.map → icon-5f3da14a.js.map} +1 -1
  35. package/dist/{icon-590f8eb3.js → icon-f3de6e3a.js} +2 -2
  36. package/dist/{icon-590f8eb3.js.map → icon-f3de6e3a.js.map} +1 -1
  37. package/dist/{index-157d4b89.js → index-20a7841f.js} +2 -2
  38. package/dist/{index-157d4b89.js.map → index-20a7841f.js.map} +1 -1
  39. package/dist/{index-463d0c73.js → index-7ec85110.js} +2 -2
  40. package/dist/{index-463d0c73.js.map → index-7ec85110.js.map} +1 -1
  41. package/dist/{isArrayLikeObject-6a001191.js → isArrayLikeObject-5da4b548.js} +2 -2
  42. package/dist/{isArrayLikeObject-6a001191.js.map → isArrayLikeObject-5da4b548.js.map} +1 -1
  43. package/dist/lib/canvas-controller.es.js +1 -1
  44. package/dist/lib/canvas-controller.js +1 -1
  45. package/dist/lib/canvas.es.js +1 -1
  46. package/dist/lib/canvas.js +1 -1
  47. package/dist/lib/context-menu.es.js +1 -1
  48. package/dist/lib/context-menu.js +1 -1
  49. package/dist/lib/properties/field-picker.es.js +1 -1
  50. package/dist/lib/properties/field-picker.js +1 -1
  51. package/dist/lib/properties/flexible-table.es.js +1 -1
  52. package/dist/lib/properties/flexible-table.js +1 -1
  53. package/dist/lib/properties.es.js +1 -1
  54. package/dist/lib/properties.js +1 -1
  55. package/dist/styles/common-canvas.min.css +1 -1
  56. package/dist/styles/common-canvas.min.css.map +1 -1
  57. package/dist/toolbar-9f4c1709.js +2 -0
  58. package/dist/toolbar-9f4c1709.js.map +1 -0
  59. package/dist/toolbar-c2ec8f11.js +2 -0
  60. package/dist/toolbar-c2ec8f11.js.map +1 -0
  61. package/locales/common-properties/locales/de.json +1 -1
  62. package/locales/common-properties/locales/es.json +1 -1
  63. package/locales/common-properties/locales/fr.json +1 -1
  64. package/locales/common-properties/locales/it.json +1 -1
  65. package/locales/common-properties/locales/ja.json +1 -1
  66. package/locales/common-properties/locales/ko.json +1 -1
  67. package/locales/common-properties/locales/pt-br.json +1 -1
  68. package/locales/common-properties/locales/sv.json +1 -1
  69. package/locales/common-properties/locales/zh-CN.json +1 -1
  70. package/locales/common-properties/locales/zh-TW.json +1 -1
  71. package/package.json +1 -1
  72. package/src/color-picker/color-picker.jsx +30 -7
  73. package/src/color-picker/color-picker.scss +1 -1
  74. package/src/color-picker/index.js +18 -0
  75. package/src/command-actions/colorSelectedObjectsAction.js +2 -1
  76. package/src/common-canvas/canvas-controller-menu-utils.js +2 -2
  77. package/src/common-canvas/cc-context-toolbar.jsx +53 -33
  78. package/src/common-canvas/cc-text-toolbar.jsx +8 -15
  79. package/src/common-canvas/common-canvas.scss +8 -15
  80. package/src/common-canvas/constants/canvas-constants.js +1 -0
  81. package/src/common-canvas/svg-canvas-d3.js +1 -1
  82. package/src/common-canvas/svg-canvas-renderer.js +26 -10
  83. package/src/common-canvas/svg-canvas-utils-textarea.js +1 -1
  84. package/src/common-properties/components/flexible-table/flexible-table.jsx +8 -5
  85. package/src/context-menu/common-context-menu.jsx +2 -2
  86. package/src/object-model/config-utils.js +20 -1
  87. package/src/object-model/pipeline-out-handler.js +3 -0
  88. package/src/toolbar/toolbar-action-item.jsx +122 -40
  89. package/src/toolbar/toolbar-action-sub-area.jsx +126 -0
  90. package/src/toolbar/toolbar-overflow-item.jsx +61 -14
  91. package/src/toolbar/toolbar-overflow-menu.jsx +77 -0
  92. package/src/toolbar/toolbar-utils.js +33 -0
  93. package/src/toolbar/toolbar.jsx +17 -24
  94. package/src/toolbar/toolbar.scss +44 -21
  95. package/stats.html +1 -1
  96. package/dist/canvas-constants-187a30d5.js +0 -2
  97. package/dist/canvas-controller-3edea15e.js +0 -2
  98. package/dist/canvas-controller-3edea15e.js.map +0 -1
  99. package/dist/canvas-controller-896694e3.js +0 -2
  100. package/dist/canvas-controller-896694e3.js.map +0 -1
  101. package/dist/common-canvas-88479b3e.js +0 -2
  102. package/dist/common-canvas-88479b3e.js.map +0 -1
  103. package/dist/common-canvas-df45ad40.js +0 -2
  104. package/dist/common-canvas-df45ad40.js.map +0 -1
  105. package/dist/common-properties-11732433.js +0 -2
  106. package/dist/common-properties-11732433.js.map +0 -1
  107. package/dist/common-properties-57768e63.js +0 -2
  108. package/dist/common-properties-57768e63.js.map +0 -1
  109. package/dist/context-menu-wrapper-8f68be70.js +0 -2
  110. package/dist/context-menu-wrapper-8f68be70.js.map +0 -1
  111. package/dist/context-menu-wrapper-d1ff456a.js +0 -2
  112. package/dist/context-menu-wrapper-d1ff456a.js.map +0 -1
  113. package/dist/datarecord-metadata-v3-schema-36dfc3cd.js +0 -2
  114. package/dist/datarecord-metadata-v3-schema-36dfc3cd.js.map +0 -1
  115. package/dist/datarecord-metadata-v3-schema-9e9ba30d.js +0 -2
  116. package/dist/datarecord-metadata-v3-schema-9e9ba30d.js.map +0 -1
  117. package/dist/toolbar-3affe026.js +0 -2
  118. package/dist/toolbar-3affe026.js.map +0 -1
  119. package/dist/toolbar-7140292d.js +0 -2
  120. package/dist/toolbar-7140292d.js.map +0 -1
  121. package/src/color-picker/color-picker-panel.jsx +0 -61
@@ -1,2 +0,0 @@
1
- "use strict";var e=require("./createClass-826941b3.js"),t=require("./getPrototypeOf-1e698126.js"),n=require("react"),r=require("./extends-1b35a664.js"),o=require("react-contextmenu"),i=require("@carbon/icons-react"),l=require("./canvas-logger-6f90b136.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(n);function u(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=t._getPrototypeOf(e);if(n){var i=t._getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return t._possibleConstructorReturn(this,r)}}var s=function(n){t._inherits(o,n);var r=u(o);function o(n){var i;return e._classCallCheck(this,o),(i=r.call(this,n)).logger=new l.Logger("CC-ContextMenu"),i.onClick=i.onClick.bind(t._assertThisInitialized(i)),i}return e._createClass(o,[{key:"onClick",value:function(e){var t=e.target.dataset.color;this.props.clickActionHandler(t)}},{key:"render",value:function(){return this.logger.log("render"),c.default.createElement("div",{className:"color-picker-panel",onClick:this.onClick},c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-white-0",className:"color-picker-item white-0"}),c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-yellow-20",className:"color-picker-item yellow-20"}),c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-20",className:"color-picker-item gray-20"}),c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-20",className:"color-picker-item green-20"}),c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-20",className:"color-picker-item teal-20"}),c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-20",className:"color-picker-item cyan-20"}),c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-red-50",className:"color-picker-item red-50"}),c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-orange-40",className:"color-picker-item orange-40"}),c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-50",className:"color-picker-item gray-50"}),c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-50",className:"color-picker-item green-50"}),c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-50",className:"color-picker-item teal-50"}),c.default.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-50",className:"color-picker-item cyan-50"}))}}]),o}(c.default.Component);function d(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=t._getPrototypeOf(e);if(n){var i=t._getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return t._possibleConstructorReturn(this,r)}}var f=function(n){t._inherits(a,n);var l=d(a);function a(n){var r;return e._classCallCheck(this,a),(r=l.call(this,n)).state={},r.itemSelected=r.itemSelected.bind(t._assertThisInitialized(r)),r.colorClicked=r.colorClicked.bind(t._assertThisInitialized(r)),r}return e._createClass(a,[{key:"onContextMenu",value:function(e){e.preventDefault()}},{key:"itemSelected",value:function(e,t){this.props.contextHandler(e),t&&t.stopPropagation()}},{key:"colorClicked",value:function(e){this.props.contextHandler("colorSelectedObjects",{color:e})}},{key:"calculateMenuSize",value:function(e){for(var t=0,n=0;n<e.length;++n){e[n].divider&&t++}return{height:30*(e.length-t)+1*t,width:160}}},{key:"calculateMenuPos",value:function(e,t,n){var r={x:e.x,y:e.y};return e.y+t.height>n.height&&(r.y=n.height-t.height-5,r.y<0&&(r.y=0)),e.x+t.width>n.width&&(r.x-=t.width),r.x+=1,r.y+=1,r}},{key:"areAllSubmenuItemsDisabled",value:function(e){var t=0,n=0;return e.forEach((function(e){e.divider||t++,!1===e.enable&&n++})),n===t}},{key:"buildMenu",value:function(e,t,n,i){for(var l={className:"contextmenu-divider"},a=[],u=0,s=!1,d=0;d<e.length;++d){var f=e[d].divider,h=e[d].submenu;if(f)s||(a.push(c.default.createElement(o.MenuItem,{attributes:l,key:d+1,onClick:function(){},divider:!0})),u+=1,s=!0);else if("colorBackground"===e[d].action){s=!1;var p={width:160,height:50},v=this.buildColorPickerPanel(),m=this.buildSubMenu(e,d,v,u,n,t,p,i,!1);a.push(m),u+=30}else if(h){s=!1;var k={disabled:this.areAllSubmenuItemsDisabled(e[d].menu)},y=this.calculateMenuSize(e[d].menu),b=this.buildMenu(e[d].menu,t,n,i),g=this.buildSubMenu(e,d,b,u,n,t,y,i,k);a.push(g),u+=30}else{s=!1;var x={disabled:!1===e[d].enable};a.push(c.default.createElement(o.MenuItem,r._extends({onClick:this.itemSelected.bind(null,e[d].action),key:d+1},x),e[d].label)),u+=30}}return a}},{key:"buildColorPickerPanel",value:function(){return c.default.createElement(s,{clickActionHandler:this.colorClicked})}},{key:"buildSubMenu",value:function(e,t,n,l,a,u,s,d,f){var h=this.buildRtlState(a,u,s,d),p=this.buildSubMenuPosStyle(l,a,s,d),v=c.default.createElement(i.ChevronRight16,null),m=c.default.createElement("div",null,e[t].label,v," ");return c.default.createElement(o.SubMenu,r._extends({title:m,key:t+1,className:"contextmenu-submenu",rtl:h},f),c.default.createElement("div",{key:t+1,style:p,className:"context-menu-popover"},n))}},{key:"buildRtlState",value:function(e,t,n,r){return e.x+t.width+n.width>r.right}},{key:"buildSubMenuPosStyle",value:function(e,t,n,r){var o=r.bottom-(t.y+e+n.height);return{top:(o>0?0:o-5)+"px"}}},{key:"render",value:function(){var e=this.calculateMenuSize(this.props.menuDefinition),t=this.calculateMenuPos(this.props.mousePos,e,this.props.canvasRect),n={left:t.x+"px",top:t.y+"px"},r=this.buildMenu(this.props.menuDefinition,e,t,this.props.canvasRect);return c.default.createElement("div",{id:"context-menu-popover",className:"context-menu-popover",style:n,onContextMenu:this.onContextMenu},r)}}]),a}(c.default.Component);function h(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=t._getPrototypeOf(e);if(n){var i=t._getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return t._possibleConstructorReturn(this,r)}}var p=function(n){t._inherits(o,n);var r=h(o);function o(n){var i;return e._classCallCheck(this,o),(i=r.call(this,n)).state={},i.contextMenuClicked=i.contextMenuClicked.bind(t._assertThisInitialized(i)),i.handleClickOutside=i.handleClickOutside.bind(t._assertThisInitialized(i)),i}return e._createClass(o,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleClickOutside,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleClickOutside,!0)}},{key:"getCanvasRect",value:function(){var e=document.getElementById(this.props.containingDivId);if(e){var t=e.getBoundingClientRect();return{top:0,bottom:t.bottom-t.top,left:0,right:t.right-t.left,height:t.height,width:t.width}}return{top:0,bottom:200,left:0,right:50,height:200,width:50}}},{key:"handleClickOutside",value:function(e){e.ctrlKey?e.stopPropagation():this.isOverContextMenu(e)||this.isOverEllipsisButton(e)||(this.props.stopPropagation&&e.stopPropagation(),this.props.closeContextMenu())}},{key:"isOverContextMenu",value:function(e){var t=document.getElementById("context-menu-popover");return!t||t.contains(e.target)}},{key:"isOverEllipsisButton",value:function(e){for(var t=document.getElementsByClassName("d3-node-ellipsis-group"),n=!1,r=0;r<t.length;r++)!1===n&&t[r].contains(e.target)&&(n=!0);return n}},{key:"contextMenuClicked",value:function(e,t){this.props.contextMenuActionHandler(e,t)}},{key:"render",value:function(){return c.default.createElement(f,{contextHandler:this.contextMenuClicked,menuDefinition:this.props.contextMenuDef,canvasRect:this.getCanvasRect(),mousePos:this.props.contextMenuPos})}}]),o}(c.default.Component);exports.ColorPickerPanel=s,exports.ContextMenuWrapper=p;
2
- //# sourceMappingURL=context-menu-wrapper-8f68be70.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context-menu-wrapper-8f68be70.js","sources":["../src/color-picker/color-picker-panel.jsx","../src/context-menu/common-context-menu.jsx","../src/context-menu/context-menu-wrapper.jsx"],"sourcesContent":["/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport Logger from \"../logging/canvas-logger.js\";\n\n\nclass ColorPickerPanel extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.logger = new Logger(\"CC-ContextMenu\");\n\n\t\tthis.onClick = this.onClick.bind(this);\n\t}\n\n\tonClick(evt) {\n\t\tconst color = evt.target.dataset.color;\n\t\tthis.props.clickActionHandler(color);\n\t}\n\n\trender() {\n\t\tthis.logger.log(\"render\");\n\t\treturn (\n\t\t\t<div className=\"color-picker-panel\" onClick={this.onClick}>\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-white-0\"} className=\"color-picker-item white-0\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-yellow-20\"} className=\"color-picker-item yellow-20\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-gray-20\"} className=\"color-picker-item gray-20\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-green-20\"} className=\"color-picker-item green-20\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-teal-20\"} className=\"color-picker-item teal-20\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-cyan-20\"} className=\"color-picker-item cyan-20\" />\n\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-red-50\"} className=\"color-picker-item red-50\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-orange-40\"} className=\"color-picker-item orange-40\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-gray-50\"} className=\"color-picker-item gray-50\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-green-50\"} className=\"color-picker-item green-50\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-teal-50\"} className=\"color-picker-item teal-50\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-cyan-50\"} className=\"color-picker-item cyan-50\" />\n\t\t\t</div>);\n\t}\n}\n\nColorPickerPanel.propTypes = {\n\tclickActionHandler: PropTypes.func.isRequired,\n\tcloseMenu: PropTypes.func\n};\n\nexport default ColorPickerPanel;\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 */\n/* eslint no-empty-function: [\"error\", { \"allow\": [\"arrowFunctions\"] }] */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { MenuItem, SubMenu } from \"react-contextmenu\";\nimport { ChevronRight16 } from \"@carbon/icons-react\";\nimport ColorPickerPanel from \"../color-picker/color-picker-panel.jsx\";\n\n// context-menu sizing\nconst CONTEXT_MENU_WIDTH = 160; // see context-menu.css .react-context-menu margin\nconst CONTEXT_MENU_LINK_HEIGHT = 30; // see context-menu.css .react-context-menu-item height\nconst CONTEXT_MENU_DIVIDER_HEIGHT = 1; // see context-menu.css .react-context-menu-item height\nconst EXTRA_OFFSET = 5; // Extra offset for vertical menu positioning\n\n\nclass CommonContextMenu extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {};\n\t\tthis.itemSelected = this.itemSelected.bind(this);\n\t\tthis.colorClicked = this.colorClicked.bind(this);\n\t}\n\n\tonContextMenu(e) {\n\t\te.preventDefault();\n\t}\n\n\titemSelected(data, selectedEvent) {\n\t\tthis.props.contextHandler(data);\n\t\t// This stops the canvasClicked function from being fired which would\n\t\t// clear any current selections.\n\t\tif (selectedEvent) {\n\t\t\tselectedEvent.stopPropagation();\n\t\t}\n\t}\n\n\tcolorClicked(color) {\n\t\tthis.props.contextHandler(\"colorSelectedObjects\", { color });\n\t}\n\n\tcalculateMenuSize(menu) {\n\t\tvar numDividers = 0;\n\t\tfor (let i = 0; i < menu.length; ++i) {\n\t\t\tconst divider = menu[i].divider;\n\t\t\tif (divider) {\n\t\t\t\tnumDividers++;\n\t\t\t}\n\t\t}\n\n\t\tvar menuSize = {\n\t\t\theight: ((menu.length - numDividers) * CONTEXT_MENU_LINK_HEIGHT) + (numDividers * CONTEXT_MENU_DIVIDER_HEIGHT),\n\t\t\twidth: CONTEXT_MENU_WIDTH\n\t\t};\n\n\t\treturn menuSize;\n\t}\n\n\t// Returns a new position and the canvas rectangle for the context menu based on the current\n\t// mouse position and whether the menu would appear outside the edges of the page.\n\tcalculateMenuPos(mousePos, menuSize, canvasRect) {\n\t\tconst menuPos = { x: mousePos.x, y: mousePos.y };\n\n\t\t// Reposition contextMenu if it will show off the bottom of the page\n\t\tif (mousePos.y + menuSize.height > canvasRect.height) {\n\t\t\tmenuPos.y = canvasRect.height - menuSize.height - EXTRA_OFFSET; // Move up by extra offset so it looks nice\n\n\t\t\t// If repositioning the menu would push it off the top of the page\n\t\t\t// (in very short browser windows) position it at the top.\n\t\t\tif (menuPos.y < 0) {\n\t\t\t\tmenuPos.y = 0;\n\t\t\t}\n\t\t}\n\n\t\t// Reposition contextMenu if it will show off the right of the page\n\t\tif (mousePos.x + menuSize.width > canvasRect.width) {\n\t\t\tmenuPos.x -= menuSize.width;\n\t\t}\n\n\t\t// Add a pixel to x and y because on Chrome without this the context menu\n\t\t// appears with the top corner of the first menu item under the mouse\n\t\t// cursor. This highlights the first menu item (which looks weird) and, if\n\t\t// the first item is a cascade menu, automatically opens the sub-menu.\n\t\tmenuPos.x += 1;\n\t\tmenuPos.y += 1;\n\n\t\treturn menuPos;\n\t}\n\n\tareAllSubmenuItemsDisabled(submenuItems) {\n\t\tlet itemCount = 0;\n\t\tlet disabledCount = 0;\n\t\tsubmenuItems.forEach(function(submenuItem) {\n\t\t\tif (!submenuItem.divider) {\n\t\t\t\titemCount++;\n\t\t\t}\n\t\t\tif (submenuItem.enable === false) {\n\t\t\t\tdisabledCount++;\n\t\t\t}\n\t\t});\n\t\treturn disabledCount === itemCount;\n\t}\n\n\tbuildMenu(menuDefinition, menuSize, menuPos, canvasRect) {\n\t\tconst customDivider = {\n\t\t\tclassName: \"contextmenu-divider\"\n\t\t};\n\n\t\tconst menuItems = [];\n\n\t\tlet runningYPos = 0;\n\t\t// Records if we have just displayed a divider. This is useful because we\n\t\t// only want to display one divider if there is a divider element\n\t\t// immediately after another divider element in the menuDefintion array.\n\t\tlet previousDivider = false;\n\n\t\tfor (let i = 0; i < menuDefinition.length; ++i) {\n\t\t\tconst divider = menuDefinition[i].divider;\n\t\t\tconst submenu = menuDefinition[i].submenu;\n\n\t\t\tif (divider) {\n\t\t\t\tif (!previousDivider) {\n\t\t\t\t\tmenuItems.push(<MenuItem attributes={customDivider} key={i + 1} onClick={() => {}} divider />);\n\t\t\t\t\trunningYPos += CONTEXT_MENU_DIVIDER_HEIGHT;\n\t\t\t\t\tpreviousDivider = true;\n\t\t\t\t}\n\t\t\t} else if (menuDefinition[i].action === \"colorBackground\") {\n\t\t\t\tpreviousDivider = false;\n\t\t\t\tconst disabled = false;\n\t\t\t\tconst subMenuSize = { width: CONTEXT_MENU_WIDTH, height: 50 };\n\t\t\t\tconst subMenuContent = this.buildColorPickerPanel();\n\n\t\t\t\tconst subMenu = this.buildSubMenu(\n\t\t\t\t\tmenuDefinition, i, subMenuContent, runningYPos, menuPos, menuSize, subMenuSize, canvasRect, disabled);\n\t\t\t\tmenuItems.push(subMenu);\n\n\t\t\t\trunningYPos += CONTEXT_MENU_LINK_HEIGHT;\n\n\t\t\t} else if (submenu) {\n\t\t\t\tpreviousDivider = false;\n\t\t\t\tconst disabled = { disabled: this.areAllSubmenuItemsDisabled(menuDefinition[i].menu) };\n\t\t\t\tconst subMenuSize = this.calculateMenuSize(menuDefinition[i].menu);\n\t\t\t\tconst subMenuContent = this.buildMenu(menuDefinition[i].menu, menuSize, menuPos, canvasRect);\n\n\t\t\t\tconst subMenu = this.buildSubMenu(\n\t\t\t\t\tmenuDefinition, i, subMenuContent, runningYPos, menuPos, menuSize, subMenuSize, canvasRect, disabled);\n\t\t\t\tmenuItems.push(subMenu);\n\n\t\t\t\trunningYPos += CONTEXT_MENU_LINK_HEIGHT;\n\n\t\t\t} else {\n\t\t\t\tpreviousDivider = false;\n\t\t\t\tconst disabled = { disabled: menuDefinition[i].enable === false };\n\t\t\t\tmenuItems.push(\n\t\t\t\t\t<MenuItem onClick={this.itemSelected.bind(null, menuDefinition[i].action)} key={i + 1} {...disabled}>\n\t\t\t\t\t\t{menuDefinition[i].label}\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t\trunningYPos += CONTEXT_MENU_LINK_HEIGHT;\n\t\t\t}\n\t\t}\n\t\treturn menuItems;\n\t}\n\n\tbuildColorPickerPanel() {\n\t\treturn (\n\t\t\t<ColorPickerPanel clickActionHandler={this.colorClicked} />\n\t\t);\n\t}\n\n\tbuildSubMenu(menuDefinition, index, subMenuContent, runningYPos, menuPos,\n\t\tmenuSize, subMenuSize, canvasRect, disabled) {\n\t\tconst rtl = this.buildRtlState(menuPos, menuSize, subMenuSize, canvasRect);\n\t\tconst subMenuPosStyle = this.buildSubMenuPosStyle(runningYPos, menuPos, subMenuSize, canvasRect);\n\n\t\tconst icon = (<ChevronRight16 />);\n\t\tconst menuItem = <div>{menuDefinition[index].label}{icon} </div>;\n\n\t\treturn (\n\t\t\t<SubMenu title={menuItem} key={index + 1} className=\"contextmenu-submenu\" rtl={rtl} {...disabled}>\n\t\t\t\t<div key={index + 1} style={subMenuPosStyle} className=\"context-menu-popover\">\n\t\t\t\t\t{subMenuContent}\n\t\t\t\t</div>\n\t\t\t</SubMenu>\n\t\t);\n\t}\n\n\t// Returns a boolean to indicate whether the submenu should appear on the\n\t// right of the context menu (rtl === false) or on the left of the context\n\t// menu (rtl === true).\n\tbuildRtlState(menuPos, menuSize, subMenuSize, canvasRect) {\n\t\t// Ensure that the combined menu position, plus the menu width,\n\t\t// plus the submenu width, does not exceed the viewport bounds.\n\t\treturn (menuPos.x + menuSize.width + subMenuSize.width > canvasRect.right);\n\n\t}\n\n\t// Returns a style object that can be applied to the sub-menu to adjust\n\t// its vertical (y) position. This may be necessary if the submenu is tall\n\t// enough that it would be displayed off the bottom of the canvas area.\n\tbuildSubMenuPosStyle(runningYPos, menuPos, subMenuSize, canvasRect) {\n\t\t// Does the submenu go below the bottom of the viewport?\n\t\tconst y = canvasRect.bottom - (menuPos.y + runningYPos + subMenuSize.height);\n\n\t\t// If submenu is not below the viewport bottom set offset to 0 so the\n\t\t// submenu will not be moved. Otherwise, y will be used to move the\n\t\t// submenu up fully into the view port.\n\t\tconst offset = (y > 0) ? 0 : y - EXTRA_OFFSET;\n\n\t\tconst subMenuPosStyle = {\n\t\t\ttop: offset + \"px\" // Use negative to push the menu up\n\t\t};\n\t\treturn subMenuPosStyle;\n\t}\n\n\trender() {\n\t\t// Reposition contextMenu so that it does not show off the screen\n\t\tconst menuSize = this.calculateMenuSize(this.props.menuDefinition);\n\t\tconst menuPos = this.calculateMenuPos(this.props.mousePos, menuSize, this.props.canvasRect);\n\t\tconst posStyle = {\n\t\t\tleft: menuPos.x + \"px\",\n\t\t\ttop: menuPos.y + \"px\"\n\t\t};\n\n\t\tconst menuItems = this.buildMenu(this.props.menuDefinition, menuSize, menuPos, this.props.canvasRect);\n\n\t\treturn (\n\t\t\t<div id=\"context-menu-popover\" className=\"context-menu-popover\" style={posStyle} onContextMenu={this.onContextMenu}>\n\t\t\t\t{menuItems}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nCommonContextMenu.propTypes = {\n\tcontextHandler: PropTypes.func.isRequired,\n\tmenuDefinition: PropTypes.array.isRequired,\n\tcanvasRect: PropTypes.object.isRequired,\n\tmousePos: PropTypes.object.isRequired\n};\n\nexport default CommonContextMenu;\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 */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport CommonContextMenu from \"./common-context-menu.jsx\";\n\nexport default class ContextMenuWrapper extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {};\n\n\t\tthis.contextMenuClicked = this.contextMenuClicked.bind(this);\n\t\tthis.handleClickOutside = this.handleClickOutside.bind(this);\n\t}\n\n\tcomponentDidMount() {\n\t\tdocument.addEventListener(\"click\", this.handleClickOutside, true);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"click\", this.handleClickOutside, true);\n\t}\n\n\t// Returns an object that describes the dimensions of a rectangle for the\n\t// canvas div with coordinates based on the top left corner of the div. This\n\t// will match the coordinates for the mouse position where the user clicked,\n\t// which is specified in this.props.contextMenuPos object.\n\tgetCanvasRect() {\n\t\tconst containingDiv = document.getElementById(this.props.containingDivId);\n\t\tif (containingDiv) {\n\t\t\tconst clientRect = containingDiv.getBoundingClientRect();\n\t\t\treturn {\n\t\t\t\ttop: 0,\n\t\t\t\tbottom: clientRect.bottom - clientRect.top,\n\t\t\t\tleft: 0,\n\t\t\t\tright: clientRect.right - clientRect.left,\n\t\t\t\theight: clientRect.height,\n\t\t\t\twidth: clientRect.width\n\t\t\t};\n\t\t}\n\t\t// Assist Jests tests to run when containingDiv is not available.\n\t\treturn { top: 0, bottom: 200, left: 0, right: 50, height: 200, width: 50 };\n\t}\n\n\thandleClickOutside(e) {\n\t\t// On Safari, when a user is displaying the context menu with a ctrl-click\n\t\t// (which is a supported context menu gesture on the Mac) a secondary click\n\t\t// event is emmitted which is received here with the ctrlKey field enabled.\n\t\t// So we ignore that event otherwse, if we continue, the context menu will\n\t\t// be closed.\n\t\tif (e.ctrlKey) {\n\t\t\te.stopPropagation();\n\t\t\treturn;\n\t\t}\n\n\t\t// If the click was anywhere outside the context menu and\n\t\t// the ellipsis button we just close the menu.\n\t\tif (!this.isOverContextMenu(e) && !this.isOverEllipsisButton(e)) {\n\t\t\t// This stop propagation is needed in common canvas so that selected nodes will\n\t\t\t// remain selected even after clicking outside the context menu to close the menu.\n\t\t\tif (this.props.stopPropagation) {\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t\tthis.props.closeContextMenu();\n\t\t}\n\t}\n\n\t// Retruns true if the event occurred over the context menu.\n\tisOverContextMenu(e) {\n\t\tconst domNode = document.getElementById(\"context-menu-popover\");\n\t\treturn !domNode || domNode.contains(e.target);\n\t}\n\n\t// Returns true if the event occurred over the ellipsis button. Typically\n\t// there will be only one ellipsis button on the canvas, since they are only\n\t// displayed on hover, but in some test cicumstances there might be more\n\t// than one.\n\tisOverEllipsisButton(e) {\n\t\tconst ellipsisNodes = document.getElementsByClassName(\"d3-node-ellipsis-group\");\n\t\tlet state = false;\n\t\tfor (let i = 0; i < ellipsisNodes.length; i++) {\n\t\t\tif (state === false && ellipsisNodes[i].contains(e.target)) {\n\t\t\t\tstate = true;\n\t\t\t}\n\t\t}\n\t\treturn state;\n\t}\n\n\tcontextMenuClicked(action, param) {\n\t\tthis.props.contextMenuActionHandler(action, param);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<CommonContextMenu\n\t\t\t\tcontextHandler={this.contextMenuClicked}\n\t\t\t\tmenuDefinition={this.props.contextMenuDef}\n\t\t\t\tcanvasRect={this.getCanvasRect()}\n\t\t\t\tmousePos={this.props.contextMenuPos}\n\t\t\t/>\n\t\t);\n\t}\n}\n\nContextMenuWrapper.propTypes = {\n\tcontextMenuDef: PropTypes.array.isRequired,\n\tcontainingDivId: PropTypes.string.isRequired,\n\tcontextMenuPos: PropTypes.object.isRequired,\n\tcontextMenuActionHandler: PropTypes.func.isRequired,\n\tcloseContextMenu: PropTypes.func.isRequired,\n\tstopPropagation: PropTypes.bool\n};\n"],"names":["_React$Component","_inherits","ColorPickerPanel","_super","_createSuper","props","_this","_classCallCheck","call","logger","Logger","onClick","bind","_assertThisInitialized","_createClass","key","value","evt","color","target","dataset","this","clickActionHandler","log","React","createElement","className","tabIndex","Component","CommonContextMenu","state","itemSelected","colorClicked","e","preventDefault","data","selectedEvent","contextHandler","stopPropagation","menu","numDividers","i","length","divider","height","width","mousePos","menuSize","canvasRect","menuPos","x","y","submenuItems","itemCount","disabledCount","forEach","submenuItem","enable","menuDefinition","customDivider","menuItems","runningYPos","previousDivider","submenu","push","MenuItem","attributes","action","subMenuSize","subMenuContent","buildColorPickerPanel","subMenu","buildSubMenu","disabled","areAllSubmenuItemsDisabled","calculateMenuSize","buildMenu","_extends","label","index","rtl","buildRtlState","subMenuPosStyle","buildSubMenuPosStyle","icon","ChevronRight16","menuItem","SubMenu","title","style","right","bottom","top","calculateMenuPos","posStyle","left","id","onContextMenu","ContextMenuWrapper","contextMenuClicked","handleClickOutside","document","addEventListener","removeEventListener","containingDiv","getElementById","containingDivId","clientRect","getBoundingClientRect","ctrlKey","isOverContextMenu","isOverEllipsisButton","closeContextMenu","domNode","contains","ellipsisNodes","getElementsByClassName","param","contextMenuActionHandler","contextMenuDef","getCanvasRect","contextMenuPos"],"mappings":"szBAkBiD,eAG3BA,GAAAC,YAAAC,EAAAF,GAAA,IAAAG,EAAAC,EAAAF,GACrB,SAAAA,EAAYG,GAAO,IAAAC,EAIqB,OAJrBC,uBAAAL,IAClBI,EAAAH,EAAAK,UAAMH,IACDI,OAAS,IAAIC,SAAO,kBAEzBJ,EAAKK,QAAUL,EAAKK,QAAQC,KAAIC,yBAAAP,IAAOA,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,GAAQ,EACHW,EAAI,EAAGA,EAAI0E,EAAczE,OAAQD,KAC3B,IAAVX,GAAmBqF,EAAc1E,GAAGyE,SAASjF,EAAEd,UAClDW,GAAQ,GAGV,OAAOA,KACPf,yBAAAC,MAED,SAAmBmD,EAAQkD,GAC1BhG,KAAKhB,MAAMiH,yBAAyBnD,EAAQkD,MAC5CtG,aAAAC,MAED,WACC,OACCQ,UAAAC,cAACI,GACAQ,eAAgBhB,KAAK8E,mBACrBzC,eAAgBrC,KAAKhB,MAAMkH,eAC3BvE,WAAY3B,KAAKmG,gBACjB1E,SAAUzB,KAAKhB,MAAMoH,qBAGvBvB,CAAA,EA/F8C1E,UAAMI"}
@@ -1,2 +0,0 @@
1
- import{_ as e,a as t}from"./createClass-be661622.js";import{_ as n,a as o,b as r,c}from"./getPrototypeOf-3751add9.js";import i from"react";import{_ as l}from"./extends-093996c9.js";import{MenuItem as a,SubMenu as u}from"react-contextmenu";import{ChevronRight16 as s}from"@carbon/icons-react";import{L as d}from"./canvas-logger-3bfbcf85.js";function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,c=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(c,arguments,i)}else n=c.apply(this,arguments);return r(this,n)}}var f=function(o){n(l,o);var r=m(l);function l(t){var n;return e(this,l),(n=r.call(this,t)).logger=new d("CC-ContextMenu"),n.onClick=n.onClick.bind(c(n)),n}return t(l,[{key:"onClick",value:function(e){var t=e.target.dataset.color;this.props.clickActionHandler(t)}},{key:"render",value:function(){return this.logger.log("render"),i.createElement("div",{className:"color-picker-panel",onClick:this.onClick},i.createElement("div",{tabIndex:"0","data-color":"bkg-col-white-0",className:"color-picker-item white-0"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-yellow-20",className:"color-picker-item yellow-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-20",className:"color-picker-item gray-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-20",className:"color-picker-item green-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-20",className:"color-picker-item teal-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-20",className:"color-picker-item cyan-20"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-red-50",className:"color-picker-item red-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-orange-40",className:"color-picker-item orange-40"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-gray-50",className:"color-picker-item gray-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-green-50",className:"color-picker-item green-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-teal-50",className:"color-picker-item teal-50"}),i.createElement("div",{tabIndex:"0","data-color":"bkg-col-cyan-50",className:"color-picker-item cyan-50"}))}}]),l}(i.Component);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,c=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(c,arguments,i)}else n=c.apply(this,arguments);return r(this,n)}}var p=function(o){n(d,o);var r=h(d);function d(t){var n;return e(this,d),(n=r.call(this,t)).state={},n.itemSelected=n.itemSelected.bind(c(n)),n.colorClicked=n.colorClicked.bind(c(n)),n}return t(d,[{key:"onContextMenu",value:function(e){e.preventDefault()}},{key:"itemSelected",value:function(e,t){this.props.contextHandler(e),t&&t.stopPropagation()}},{key:"colorClicked",value:function(e){this.props.contextHandler("colorSelectedObjects",{color:e})}},{key:"calculateMenuSize",value:function(e){for(var t=0,n=0;n<e.length;++n){e[n].divider&&t++}return{height:30*(e.length-t)+1*t,width:160}}},{key:"calculateMenuPos",value:function(e,t,n){var o={x:e.x,y:e.y};return e.y+t.height>n.height&&(o.y=n.height-t.height-5,o.y<0&&(o.y=0)),e.x+t.width>n.width&&(o.x-=t.width),o.x+=1,o.y+=1,o}},{key:"areAllSubmenuItemsDisabled",value:function(e){var t=0,n=0;return e.forEach((function(e){e.divider||t++,!1===e.enable&&n++})),n===t}},{key:"buildMenu",value:function(e,t,n,o){for(var r={className:"contextmenu-divider"},c=[],u=0,s=!1,d=0;d<e.length;++d){var m=e[d].divider,f=e[d].submenu;if(m)s||(c.push(i.createElement(a,{attributes:r,key:d+1,onClick:function(){},divider:!0})),u+=1,s=!0);else if("colorBackground"===e[d].action){s=!1;var h={width:160,height:50},p=this.buildColorPickerPanel(),v=this.buildSubMenu(e,d,p,u,n,t,h,o,!1);c.push(v),u+=30}else if(f){s=!1;var k={disabled:this.areAllSubmenuItemsDisabled(e[d].menu)},y=this.calculateMenuSize(e[d].menu),b=this.buildMenu(e[d].menu,t,n,o),g=this.buildSubMenu(e,d,b,u,n,t,y,o,k);c.push(g),u+=30}else{s=!1;var x={disabled:!1===e[d].enable};c.push(i.createElement(a,l({onClick:this.itemSelected.bind(null,e[d].action),key:d+1},x),e[d].label)),u+=30}}return c}},{key:"buildColorPickerPanel",value:function(){return i.createElement(f,{clickActionHandler:this.colorClicked})}},{key:"buildSubMenu",value:function(e,t,n,o,r,c,a,d,m){var f=this.buildRtlState(r,c,a,d),h=this.buildSubMenuPosStyle(o,r,a,d),p=i.createElement(s,null),v=i.createElement("div",null,e[t].label,p," ");return i.createElement(u,l({title:v,key:t+1,className:"contextmenu-submenu",rtl:f},m),i.createElement("div",{key:t+1,style:h,className:"context-menu-popover"},n))}},{key:"buildRtlState",value:function(e,t,n,o){return e.x+t.width+n.width>o.right}},{key:"buildSubMenuPosStyle",value:function(e,t,n,o){var r=o.bottom-(t.y+e+n.height);return{top:(r>0?0:r-5)+"px"}}},{key:"render",value:function(){var e=this.calculateMenuSize(this.props.menuDefinition),t=this.calculateMenuPos(this.props.mousePos,e,this.props.canvasRect),n={left:t.x+"px",top:t.y+"px"},o=this.buildMenu(this.props.menuDefinition,e,t,this.props.canvasRect);return i.createElement("div",{id:"context-menu-popover",className:"context-menu-popover",style:n,onContextMenu:this.onContextMenu},o)}}]),d}(i.Component);function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,c=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(c,arguments,i)}else n=c.apply(this,arguments);return r(this,n)}}var k=function(o){n(l,o);var r=v(l);function l(t){var n;return e(this,l),(n=r.call(this,t)).state={},n.contextMenuClicked=n.contextMenuClicked.bind(c(n)),n.handleClickOutside=n.handleClickOutside.bind(c(n)),n}return t(l,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleClickOutside,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleClickOutside,!0)}},{key:"getCanvasRect",value:function(){var e=document.getElementById(this.props.containingDivId);if(e){var t=e.getBoundingClientRect();return{top:0,bottom:t.bottom-t.top,left:0,right:t.right-t.left,height:t.height,width:t.width}}return{top:0,bottom:200,left:0,right:50,height:200,width:50}}},{key:"handleClickOutside",value:function(e){e.ctrlKey?e.stopPropagation():this.isOverContextMenu(e)||this.isOverEllipsisButton(e)||(this.props.stopPropagation&&e.stopPropagation(),this.props.closeContextMenu())}},{key:"isOverContextMenu",value:function(e){var t=document.getElementById("context-menu-popover");return!t||t.contains(e.target)}},{key:"isOverEllipsisButton",value:function(e){for(var t=document.getElementsByClassName("d3-node-ellipsis-group"),n=!1,o=0;o<t.length;o++)!1===n&&t[o].contains(e.target)&&(n=!0);return n}},{key:"contextMenuClicked",value:function(e,t){this.props.contextMenuActionHandler(e,t)}},{key:"render",value:function(){return i.createElement(p,{contextHandler:this.contextMenuClicked,menuDefinition:this.props.contextMenuDef,canvasRect:this.getCanvasRect(),mousePos:this.props.contextMenuPos})}}]),l}(i.Component);export{k as C,f as a};
2
- //# sourceMappingURL=context-menu-wrapper-d1ff456a.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context-menu-wrapper-d1ff456a.js","sources":["../src/color-picker/color-picker-panel.jsx","../src/context-menu/common-context-menu.jsx","../src/context-menu/context-menu-wrapper.jsx"],"sourcesContent":["/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport Logger from \"../logging/canvas-logger.js\";\n\n\nclass ColorPickerPanel extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.logger = new Logger(\"CC-ContextMenu\");\n\n\t\tthis.onClick = this.onClick.bind(this);\n\t}\n\n\tonClick(evt) {\n\t\tconst color = evt.target.dataset.color;\n\t\tthis.props.clickActionHandler(color);\n\t}\n\n\trender() {\n\t\tthis.logger.log(\"render\");\n\t\treturn (\n\t\t\t<div className=\"color-picker-panel\" onClick={this.onClick}>\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-white-0\"} className=\"color-picker-item white-0\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-yellow-20\"} className=\"color-picker-item yellow-20\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-gray-20\"} className=\"color-picker-item gray-20\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-green-20\"} className=\"color-picker-item green-20\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-teal-20\"} className=\"color-picker-item teal-20\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-cyan-20\"} className=\"color-picker-item cyan-20\" />\n\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-red-50\"} className=\"color-picker-item red-50\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-orange-40\"} className=\"color-picker-item orange-40\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-gray-50\"} className=\"color-picker-item gray-50\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-green-50\"} className=\"color-picker-item green-50\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-teal-50\"} className=\"color-picker-item teal-50\" />\n\t\t\t\t<div tabIndex=\"0\" data-color={\"bkg-col-cyan-50\"} className=\"color-picker-item cyan-50\" />\n\t\t\t</div>);\n\t}\n}\n\nColorPickerPanel.propTypes = {\n\tclickActionHandler: PropTypes.func.isRequired,\n\tcloseMenu: PropTypes.func\n};\n\nexport default ColorPickerPanel;\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 */\n/* eslint no-empty-function: [\"error\", { \"allow\": [\"arrowFunctions\"] }] */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { MenuItem, SubMenu } from \"react-contextmenu\";\nimport { ChevronRight16 } from \"@carbon/icons-react\";\nimport ColorPickerPanel from \"../color-picker/color-picker-panel.jsx\";\n\n// context-menu sizing\nconst CONTEXT_MENU_WIDTH = 160; // see context-menu.css .react-context-menu margin\nconst CONTEXT_MENU_LINK_HEIGHT = 30; // see context-menu.css .react-context-menu-item height\nconst CONTEXT_MENU_DIVIDER_HEIGHT = 1; // see context-menu.css .react-context-menu-item height\nconst EXTRA_OFFSET = 5; // Extra offset for vertical menu positioning\n\n\nclass CommonContextMenu extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {};\n\t\tthis.itemSelected = this.itemSelected.bind(this);\n\t\tthis.colorClicked = this.colorClicked.bind(this);\n\t}\n\n\tonContextMenu(e) {\n\t\te.preventDefault();\n\t}\n\n\titemSelected(data, selectedEvent) {\n\t\tthis.props.contextHandler(data);\n\t\t// This stops the canvasClicked function from being fired which would\n\t\t// clear any current selections.\n\t\tif (selectedEvent) {\n\t\t\tselectedEvent.stopPropagation();\n\t\t}\n\t}\n\n\tcolorClicked(color) {\n\t\tthis.props.contextHandler(\"colorSelectedObjects\", { color });\n\t}\n\n\tcalculateMenuSize(menu) {\n\t\tvar numDividers = 0;\n\t\tfor (let i = 0; i < menu.length; ++i) {\n\t\t\tconst divider = menu[i].divider;\n\t\t\tif (divider) {\n\t\t\t\tnumDividers++;\n\t\t\t}\n\t\t}\n\n\t\tvar menuSize = {\n\t\t\theight: ((menu.length - numDividers) * CONTEXT_MENU_LINK_HEIGHT) + (numDividers * CONTEXT_MENU_DIVIDER_HEIGHT),\n\t\t\twidth: CONTEXT_MENU_WIDTH\n\t\t};\n\n\t\treturn menuSize;\n\t}\n\n\t// Returns a new position and the canvas rectangle for the context menu based on the current\n\t// mouse position and whether the menu would appear outside the edges of the page.\n\tcalculateMenuPos(mousePos, menuSize, canvasRect) {\n\t\tconst menuPos = { x: mousePos.x, y: mousePos.y };\n\n\t\t// Reposition contextMenu if it will show off the bottom of the page\n\t\tif (mousePos.y + menuSize.height > canvasRect.height) {\n\t\t\tmenuPos.y = canvasRect.height - menuSize.height - EXTRA_OFFSET; // Move up by extra offset so it looks nice\n\n\t\t\t// If repositioning the menu would push it off the top of the page\n\t\t\t// (in very short browser windows) position it at the top.\n\t\t\tif (menuPos.y < 0) {\n\t\t\t\tmenuPos.y = 0;\n\t\t\t}\n\t\t}\n\n\t\t// Reposition contextMenu if it will show off the right of the page\n\t\tif (mousePos.x + menuSize.width > canvasRect.width) {\n\t\t\tmenuPos.x -= menuSize.width;\n\t\t}\n\n\t\t// Add a pixel to x and y because on Chrome without this the context menu\n\t\t// appears with the top corner of the first menu item under the mouse\n\t\t// cursor. This highlights the first menu item (which looks weird) and, if\n\t\t// the first item is a cascade menu, automatically opens the sub-menu.\n\t\tmenuPos.x += 1;\n\t\tmenuPos.y += 1;\n\n\t\treturn menuPos;\n\t}\n\n\tareAllSubmenuItemsDisabled(submenuItems) {\n\t\tlet itemCount = 0;\n\t\tlet disabledCount = 0;\n\t\tsubmenuItems.forEach(function(submenuItem) {\n\t\t\tif (!submenuItem.divider) {\n\t\t\t\titemCount++;\n\t\t\t}\n\t\t\tif (submenuItem.enable === false) {\n\t\t\t\tdisabledCount++;\n\t\t\t}\n\t\t});\n\t\treturn disabledCount === itemCount;\n\t}\n\n\tbuildMenu(menuDefinition, menuSize, menuPos, canvasRect) {\n\t\tconst customDivider = {\n\t\t\tclassName: \"contextmenu-divider\"\n\t\t};\n\n\t\tconst menuItems = [];\n\n\t\tlet runningYPos = 0;\n\t\t// Records if we have just displayed a divider. This is useful because we\n\t\t// only want to display one divider if there is a divider element\n\t\t// immediately after another divider element in the menuDefintion array.\n\t\tlet previousDivider = false;\n\n\t\tfor (let i = 0; i < menuDefinition.length; ++i) {\n\t\t\tconst divider = menuDefinition[i].divider;\n\t\t\tconst submenu = menuDefinition[i].submenu;\n\n\t\t\tif (divider) {\n\t\t\t\tif (!previousDivider) {\n\t\t\t\t\tmenuItems.push(<MenuItem attributes={customDivider} key={i + 1} onClick={() => {}} divider />);\n\t\t\t\t\trunningYPos += CONTEXT_MENU_DIVIDER_HEIGHT;\n\t\t\t\t\tpreviousDivider = true;\n\t\t\t\t}\n\t\t\t} else if (menuDefinition[i].action === \"colorBackground\") {\n\t\t\t\tpreviousDivider = false;\n\t\t\t\tconst disabled = false;\n\t\t\t\tconst subMenuSize = { width: CONTEXT_MENU_WIDTH, height: 50 };\n\t\t\t\tconst subMenuContent = this.buildColorPickerPanel();\n\n\t\t\t\tconst subMenu = this.buildSubMenu(\n\t\t\t\t\tmenuDefinition, i, subMenuContent, runningYPos, menuPos, menuSize, subMenuSize, canvasRect, disabled);\n\t\t\t\tmenuItems.push(subMenu);\n\n\t\t\t\trunningYPos += CONTEXT_MENU_LINK_HEIGHT;\n\n\t\t\t} else if (submenu) {\n\t\t\t\tpreviousDivider = false;\n\t\t\t\tconst disabled = { disabled: this.areAllSubmenuItemsDisabled(menuDefinition[i].menu) };\n\t\t\t\tconst subMenuSize = this.calculateMenuSize(menuDefinition[i].menu);\n\t\t\t\tconst subMenuContent = this.buildMenu(menuDefinition[i].menu, menuSize, menuPos, canvasRect);\n\n\t\t\t\tconst subMenu = this.buildSubMenu(\n\t\t\t\t\tmenuDefinition, i, subMenuContent, runningYPos, menuPos, menuSize, subMenuSize, canvasRect, disabled);\n\t\t\t\tmenuItems.push(subMenu);\n\n\t\t\t\trunningYPos += CONTEXT_MENU_LINK_HEIGHT;\n\n\t\t\t} else {\n\t\t\t\tpreviousDivider = false;\n\t\t\t\tconst disabled = { disabled: menuDefinition[i].enable === false };\n\t\t\t\tmenuItems.push(\n\t\t\t\t\t<MenuItem onClick={this.itemSelected.bind(null, menuDefinition[i].action)} key={i + 1} {...disabled}>\n\t\t\t\t\t\t{menuDefinition[i].label}\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t\trunningYPos += CONTEXT_MENU_LINK_HEIGHT;\n\t\t\t}\n\t\t}\n\t\treturn menuItems;\n\t}\n\n\tbuildColorPickerPanel() {\n\t\treturn (\n\t\t\t<ColorPickerPanel clickActionHandler={this.colorClicked} />\n\t\t);\n\t}\n\n\tbuildSubMenu(menuDefinition, index, subMenuContent, runningYPos, menuPos,\n\t\tmenuSize, subMenuSize, canvasRect, disabled) {\n\t\tconst rtl = this.buildRtlState(menuPos, menuSize, subMenuSize, canvasRect);\n\t\tconst subMenuPosStyle = this.buildSubMenuPosStyle(runningYPos, menuPos, subMenuSize, canvasRect);\n\n\t\tconst icon = (<ChevronRight16 />);\n\t\tconst menuItem = <div>{menuDefinition[index].label}{icon} </div>;\n\n\t\treturn (\n\t\t\t<SubMenu title={menuItem} key={index + 1} className=\"contextmenu-submenu\" rtl={rtl} {...disabled}>\n\t\t\t\t<div key={index + 1} style={subMenuPosStyle} className=\"context-menu-popover\">\n\t\t\t\t\t{subMenuContent}\n\t\t\t\t</div>\n\t\t\t</SubMenu>\n\t\t);\n\t}\n\n\t// Returns a boolean to indicate whether the submenu should appear on the\n\t// right of the context menu (rtl === false) or on the left of the context\n\t// menu (rtl === true).\n\tbuildRtlState(menuPos, menuSize, subMenuSize, canvasRect) {\n\t\t// Ensure that the combined menu position, plus the menu width,\n\t\t// plus the submenu width, does not exceed the viewport bounds.\n\t\treturn (menuPos.x + menuSize.width + subMenuSize.width > canvasRect.right);\n\n\t}\n\n\t// Returns a style object that can be applied to the sub-menu to adjust\n\t// its vertical (y) position. This may be necessary if the submenu is tall\n\t// enough that it would be displayed off the bottom of the canvas area.\n\tbuildSubMenuPosStyle(runningYPos, menuPos, subMenuSize, canvasRect) {\n\t\t// Does the submenu go below the bottom of the viewport?\n\t\tconst y = canvasRect.bottom - (menuPos.y + runningYPos + subMenuSize.height);\n\n\t\t// If submenu is not below the viewport bottom set offset to 0 so the\n\t\t// submenu will not be moved. Otherwise, y will be used to move the\n\t\t// submenu up fully into the view port.\n\t\tconst offset = (y > 0) ? 0 : y - EXTRA_OFFSET;\n\n\t\tconst subMenuPosStyle = {\n\t\t\ttop: offset + \"px\" // Use negative to push the menu up\n\t\t};\n\t\treturn subMenuPosStyle;\n\t}\n\n\trender() {\n\t\t// Reposition contextMenu so that it does not show off the screen\n\t\tconst menuSize = this.calculateMenuSize(this.props.menuDefinition);\n\t\tconst menuPos = this.calculateMenuPos(this.props.mousePos, menuSize, this.props.canvasRect);\n\t\tconst posStyle = {\n\t\t\tleft: menuPos.x + \"px\",\n\t\t\ttop: menuPos.y + \"px\"\n\t\t};\n\n\t\tconst menuItems = this.buildMenu(this.props.menuDefinition, menuSize, menuPos, this.props.canvasRect);\n\n\t\treturn (\n\t\t\t<div id=\"context-menu-popover\" className=\"context-menu-popover\" style={posStyle} onContextMenu={this.onContextMenu}>\n\t\t\t\t{menuItems}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nCommonContextMenu.propTypes = {\n\tcontextHandler: PropTypes.func.isRequired,\n\tmenuDefinition: PropTypes.array.isRequired,\n\tcanvasRect: PropTypes.object.isRequired,\n\tmousePos: PropTypes.object.isRequired\n};\n\nexport default CommonContextMenu;\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 */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport CommonContextMenu from \"./common-context-menu.jsx\";\n\nexport default class ContextMenuWrapper extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {};\n\n\t\tthis.contextMenuClicked = this.contextMenuClicked.bind(this);\n\t\tthis.handleClickOutside = this.handleClickOutside.bind(this);\n\t}\n\n\tcomponentDidMount() {\n\t\tdocument.addEventListener(\"click\", this.handleClickOutside, true);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"click\", this.handleClickOutside, true);\n\t}\n\n\t// Returns an object that describes the dimensions of a rectangle for the\n\t// canvas div with coordinates based on the top left corner of the div. This\n\t// will match the coordinates for the mouse position where the user clicked,\n\t// which is specified in this.props.contextMenuPos object.\n\tgetCanvasRect() {\n\t\tconst containingDiv = document.getElementById(this.props.containingDivId);\n\t\tif (containingDiv) {\n\t\t\tconst clientRect = containingDiv.getBoundingClientRect();\n\t\t\treturn {\n\t\t\t\ttop: 0,\n\t\t\t\tbottom: clientRect.bottom - clientRect.top,\n\t\t\t\tleft: 0,\n\t\t\t\tright: clientRect.right - clientRect.left,\n\t\t\t\theight: clientRect.height,\n\t\t\t\twidth: clientRect.width\n\t\t\t};\n\t\t}\n\t\t// Assist Jests tests to run when containingDiv is not available.\n\t\treturn { top: 0, bottom: 200, left: 0, right: 50, height: 200, width: 50 };\n\t}\n\n\thandleClickOutside(e) {\n\t\t// On Safari, when a user is displaying the context menu with a ctrl-click\n\t\t// (which is a supported context menu gesture on the Mac) a secondary click\n\t\t// event is emmitted which is received here with the ctrlKey field enabled.\n\t\t// So we ignore that event otherwse, if we continue, the context menu will\n\t\t// be closed.\n\t\tif (e.ctrlKey) {\n\t\t\te.stopPropagation();\n\t\t\treturn;\n\t\t}\n\n\t\t// If the click was anywhere outside the context menu and\n\t\t// the ellipsis button we just close the menu.\n\t\tif (!this.isOverContextMenu(e) && !this.isOverEllipsisButton(e)) {\n\t\t\t// This stop propagation is needed in common canvas so that selected nodes will\n\t\t\t// remain selected even after clicking outside the context menu to close the menu.\n\t\t\tif (this.props.stopPropagation) {\n\t\t\t\te.stopPropagation();\n\t\t\t}\n\t\t\tthis.props.closeContextMenu();\n\t\t}\n\t}\n\n\t// Retruns true if the event occurred over the context menu.\n\tisOverContextMenu(e) {\n\t\tconst domNode = document.getElementById(\"context-menu-popover\");\n\t\treturn !domNode || domNode.contains(e.target);\n\t}\n\n\t// Returns true if the event occurred over the ellipsis button. Typically\n\t// there will be only one ellipsis button on the canvas, since they are only\n\t// displayed on hover, but in some test cicumstances there might be more\n\t// than one.\n\tisOverEllipsisButton(e) {\n\t\tconst ellipsisNodes = document.getElementsByClassName(\"d3-node-ellipsis-group\");\n\t\tlet state = false;\n\t\tfor (let i = 0; i < ellipsisNodes.length; i++) {\n\t\t\tif (state === false && ellipsisNodes[i].contains(e.target)) {\n\t\t\t\tstate = true;\n\t\t\t}\n\t\t}\n\t\treturn state;\n\t}\n\n\tcontextMenuClicked(action, param) {\n\t\tthis.props.contextMenuActionHandler(action, param);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<CommonContextMenu\n\t\t\t\tcontextHandler={this.contextMenuClicked}\n\t\t\t\tmenuDefinition={this.props.contextMenuDef}\n\t\t\t\tcanvasRect={this.getCanvasRect()}\n\t\t\t\tmousePos={this.props.contextMenuPos}\n\t\t\t/>\n\t\t);\n\t}\n}\n\nContextMenuWrapper.propTypes = {\n\tcontextMenuDef: PropTypes.array.isRequired,\n\tcontainingDivId: PropTypes.string.isRequired,\n\tcontextMenuPos: PropTypes.object.isRequired,\n\tcontextMenuActionHandler: PropTypes.func.isRequired,\n\tcloseContextMenu: PropTypes.func.isRequired,\n\tstopPropagation: PropTypes.bool\n};\n"],"names":["_React$Component","_inherits","ColorPickerPanel","_super","_createSuper","props","_this","_classCallCheck","call","logger","Logger","onClick","bind","_assertThisInitialized","_createClass","key","value","evt","color","target","dataset","this","clickActionHandler","log","React","createElement","className","tabIndex","Component","CommonContextMenu","state","itemSelected","colorClicked","e","preventDefault","data","selectedEvent","contextHandler","stopPropagation","menu","numDividers","i","length","divider","height","width","mousePos","menuSize","canvasRect","menuPos","x","y","submenuItems","itemCount","disabledCount","forEach","submenuItem","enable","menuDefinition","customDivider","menuItems","runningYPos","previousDivider","submenu","push","MenuItem","attributes","action","subMenuSize","subMenuContent","buildColorPickerPanel","subMenu","buildSubMenu","disabled","areAllSubmenuItemsDisabled","calculateMenuSize","buildMenu","_extends","label","index","rtl","buildRtlState","subMenuPosStyle","buildSubMenuPosStyle","icon","ChevronRight16","menuItem","SubMenu","title","style","right","bottom","top","calculateMenuPos","posStyle","left","id","onContextMenu","ContextMenuWrapper","contextMenuClicked","handleClickOutside","document","addEventListener","removeEventListener","containingDiv","getElementById","containingDivId","clientRect","getBoundingClientRect","ctrlKey","isOverContextMenu","isOverEllipsisButton","closeContextMenu","domNode","contains","ellipsisNodes","getElementsByClassName","param","contextMenuActionHandler","contextMenuDef","getCanvasRect","contextMenuPos"],"mappings":"2vBAkBiD,eAG3BA,GAAAC,EAAAC,EAAAF,GAAA,IAAAG,EAAAC,EAAAF,GACrB,SAAAA,EAAYG,GAAO,IAAAC,EAIqB,OAJrBC,OAAAL,IAClBI,EAAAH,EAAAK,UAAMH,IACDI,OAAS,IAAIC,EAAO,kBAEzBJ,EAAKK,QAAUL,EAAKK,QAAQC,KAAIC,EAAAP,IAAOA,EA0BvC,OAzBAQ,EAAAZ,IAAAa,cAAAC,MAED,SAAQC,GACP,IAAMC,EAAQD,EAAIE,OAAOC,QAAQF,MACjCG,KAAKhB,MAAMiB,mBAAmBJ,MAC9BH,aAAAC,MAED,WAEC,OADAK,KAAKZ,OAAOc,IAAI,UAEfC,EAAAC,qBAAKC,UAAU,qBAAqBf,QAASU,KAAKV,SACjDa,EAAAC,qBAAKE,SAAS,IAAI,aAAY,kBAAmBD,UAAU,8BAC3DF,EAAAC,qBAAKE,SAAS,IAAI,aAAY,oBAAqBD,UAAU,gCAC7DF,EAAAC,qBAAKE,SAAS,IAAI,aAAY,kBAAmBD,UAAU,8BAC3DF,EAAAC,qBAAKE,SAAS,IAAI,aAAY,mBAAoBD,UAAU,+BAC5DF,EAAAC,qBAAKE,SAAS,IAAI,aAAY,kBAAmBD,UAAU,8BAC3DF,EAAAC,qBAAKE,SAAS,IAAI,aAAY,kBAAmBD,UAAU,8BAE3DF,EAAAC,qBAAKE,SAAS,IAAI,aAAY,iBAAkBD,UAAU,6BAC1DF,EAAAC,qBAAKE,SAAS,IAAI,aAAY,oBAAqBD,UAAU,gCAC7DF,EAAAC,qBAAKE,SAAS,IAAI,aAAY,kBAAmBD,UAAU,8BAC3DF,EAAAC,qBAAKE,SAAS,IAAI,aAAY,mBAAoBD,UAAU,+BAC5DF,EAAAC,qBAA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tE9B,yBAAAC,MAED,SAAmBiB,GAMdA,EAAE4E,QACL5E,EAAEK,kBAMEjB,KAAKyF,kBAAkB7E,IAAOZ,KAAK0F,qBAAqB9E,KAGxDZ,KAAKhB,MAAMiC,iBACdL,EAAEK,kBAEHjB,KAAKhB,MAAM2G,uBAIbjG,wBAAAC,MACA,SAAkBiB,GACjB,IAAMgF,EAAUZ,SAASI,eAAe,wBACxC,OAAQQ,GAAWA,EAAQC,SAASjF,EAAEd,WAMvCJ,2BAAAC,MACA,SAAqBiB,GAGpB,IAFA,IAAMkF,EAAgBd,SAASe,uBAAuB,0BAClDtF,GAAQ,EACHW,EAAI,EAAGA,EAAI0E,EAAczE,OAAQD,KAC3B,IAAVX,GAAmBqF,EAAc1E,GAAGyE,SAASjF,EAAEd,UAClDW,GAAQ,GAGV,OAAOA,KACPf,yBAAAC,MAED,SAAmBmD,EAAQkD,GAC1BhG,KAAKhB,MAAMiH,yBAAyBnD,EAAQkD,MAC5CtG,aAAAC,MAED,WACC,OACCQ,EAAAC,cAACI,GACAQ,eAAgBhB,KAAK8E,mBACrBzC,eAAgBrC,KAAKhB,MAAMkH,eAC3BvE,WAAY3B,KAAKmG,gBACjB1E,SAAUzB,KAAKhB,MAAMoH,qBAGvBvB,CAAA,EA/F8C1E,EAAMI"}
@@ -1,2 +0,0 @@
1
- "use strict";var e=require("./createClass-826941b3.js"),t=require("./canvas-constants-5fb4e9b8.js"),i=require("./isArrayLikeObject-0cd02b77.js"),r=t._assignValue,a=i._castPath,n=i._isIndex,o=i.isObject_1,s=i._toKey;var d=function(e,t,i,d){if(!o(e))return e;for(var c=-1,p=(t=a(t,e)).length,l=p-1,u=e;null!=u&&++c<p;){var m=s(t[c]),f=i;if("__proto__"===m||"constructor"===m||"prototype"===m)return e;if(c!=l){var y=u[m];void 0===(f=d?d(y,m,u):void 0)&&(f=o(y)?y:n(t[c+1])?[]:{})}r(u,m,f),u=u[m]}return e},c=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,[{key:"do",value:function(){}},{key:"undo",value:function(){}},{key:"redo",value:function(){}},{key:"getLabel",value:function(){}}]),t}(),p=d;var l=function(e,t,i){return null==e?e:p(e,t,i)};var u=function(){},m=i._Set,f=u,y=i._setToArray,h=m&&1/y(new m([,-0]))[1]==1/0?function(e){return new m(e)}:f,b=i._SetCache,_=i._arrayIncludes,g=i._arrayIncludesWith,v=i._cacheHas,j=h,A=i._setToArray;var q=function(e,t,i){var r=-1,a=_,n=e.length,o=!0,s=[],d=s;if(i)o=!1,a=g;else if(n>=200){var c=t?null:j(e);if(c)return A(c);o=!1,a=v,d=new b}else d=t?[]:s;e:for(;++r<n;){var p=e[r],l=t?t(p):p;if(p=i||0!==p?p:0,o&&l==l){for(var u=d.length;u--;)if(d[u]===l)continue e;t&&d.push(l),s.push(p)}else a(d,l,i)||(d!==s&&d.push(l),s.push(p))}return s},x=i._baseFlatten,S=i._baseRest,I=q,w=i.isArrayLikeObject_1,k=S((function(e){return I(x(e,1,w,!0))}));function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}var M={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v3-schema.json",title:"Watson Data Platform Datarecord Metadata Schema",description:"Metadata schema for datarecords in the Watson Data Platform",type:"object",definitions:{record_schema:{description:"Description of a datarecord including column types and metadata",type:"object",properties:{id:{description:"Unique identifier",type:"string"},name:{description:"Name of datarecord",type:"string"},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v3-schema.json"],type:"string"},type:{description:"Always 'struct' for datarecord schema",type:"string"},fields:{description:"Array of field definitions",type:"array",minItems:0,items:{$ref:"#/definitions/field"},uniqueItems:!0},struct_types:{description:"The list of custom struct types to be used as field types",type:"object",patternProperties:{".":{type:"object",properties:{fields:{description:"Array of field definitions",type:"array",minItems:0,items:{$ref:"#/definitions/field"},uniqueItems:!0}}}}}},required:["id","fields"]},field:{description:"Definition of a datarecord field",type:"object",properties:{name:{description:"Field name. Must be unique within the datarecord",type:"string"},type:{description:"Field type. Can be a primitive type (string, integer, double, date, time, timestamp, binary, boolean, array[type], map[type, type]. The type can also be a reference to a struct_type declaration.)",type:"string"},nullable:{description:"Whether or not one can place null values into the field",type:"boolean",default:!1},metadata:{$ref:"#/definitions/metadata"},app_data:{$ref:"#/definitions/app_data_def"}},required:["name","type"]},metadata:{description:"Additional field metadata",type:"object",properties:{description:{description:"Field description",type:"string"},measure:{description:"Field measurement level",enum:["range","discrete","flag","set","ordered-set","typeless","collection","geospatial","default"]},modeling_role:{description:"Field role for modeling",enum:["input","target","both","none","partition","split","frequency","record-id"]},max_length:{description:"Maximum length for fields. Length is unlimited when not present",type:"number"},min_length:{description:"Minimum length for fields",type:"number"},decimal_precision:{description:"Precision for decimal, time, and timestamp types",type:"number"},decimal_scale:{description:"Scale for decimal, time, and timestamp types",type:"number"},values:{description:"Array of unique categorical values for the column",type:"array",minItems:0,items:{description:"A value discovered in the data",type:["string","number","boolean"]},uniqueItems:!0},range:{description:"Minimum and maximum discovered values for scalar data",type:"object",properties:{min:{description:"Lowest value discovered in the data",type:["string","number"]},max:{description:"Highest value discovered in the data",type:["string","number"]}},required:["min","max"]},runtime_type:{description:"Type of runtime",type:"string"},is_key:{description:"A field is key",type:"boolean"},is_signed:{description:"Signed or Unsigned for number",type:"boolean"},item_index:{description:"Item record level",type:"number"},source_field_id:{description:"Source field for a target field",type:"string"}}},app_data_def:{description:"Object containing app-specific data",type:"object",properties:{},additionalProperties:!0}}};exports.Action=c,exports._baseSet=d,exports._baseUniq=q,exports._toConsumableArray=function(e){return function(e){if(Array.isArray(e))return C(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?C(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},exports.dataRecordMetadataV3Schema=M,exports.set_1=l,exports.union_1=k;
2
- //# sourceMappingURL=datarecord-metadata-v3-schema-36dfc3cd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datarecord-metadata-v3-schema-36dfc3cd.js","sources":["../node_modules/lodash/_baseSet.js","../src/command-stack/action.js","../node_modules/lodash/set.js","../node_modules/lodash/noop.js","../node_modules/lodash/_createSet.js","../node_modules/lodash/_baseUniq.js","../node_modules/lodash/union.js","../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js"],"sourcesContent":["var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nmodule.exports = baseSet;\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 */\n\n/* eslint no-empty-function: [\"error\", { \"allow\": [\"methods\"] }] */\n\nclass Action {\n\n\t// Standard methods\n\tdo() {\n\t}\n\n\tundo() {\n\t}\n\n\tredo() {\n\t}\n\n\tgetLabel() {\n\t}\n}\n\nexport default Action;\n","var baseSet = require('./_baseSet');\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n","var baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n baseUniq = require('./_baseUniq'),\n isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nmodule.exports = union;\n","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}"],"names":["assignValue","require$$0","castPath","require$$1","isIndex","require$$2","isObject","require$$3","toKey","require$$4","_baseSet","object","path","value","customizer","index","length","lastIndex","nested","key","newValue","objValue","undefined","Action","_classCallCheck","_createClass","baseSet","set_1","noop_1","Set","noop","setToArray","_createSet","values","SetCache","arrayIncludes","arrayIncludesWith","cacheHas","createSet","require$$5","_baseUniq","array","iteratee","comparator","includes","isCommon","result","seen","set","outer","computed","seenIndex","push","baseFlatten","baseRest","baseUniq","isArrayLikeObject","union_1","arrays","_arrayLikeToArray","arr","len","i","arr2","Array","isArray","arrayLikeToArray","arrayWithoutHoles","iter","Symbol","iterator","from","iterableToArray","o","minLen","n","Object","prototype","toString","call","slice","constructor","name","test","unsupportedIterableToArray","TypeError","nonIterableSpread"],"mappings":"iJAAIA,EAAcC,eACdC,EAAWC,YACXC,EAAUC,WACVC,EAAWC,aACXC,EAAQC,aA8CZC,EAlCA,SAAiBC,EAAQC,EAAMC,EAAOC,GACpC,IAAKR,EAASK,GACZ,OAAOA,EAST,IALA,IAAII,GAAS,EACTC,GAHJJ,EAAOV,EAASU,EAAMD,IAGJK,OACdC,EAAYD,EAAS,EACrBE,EAASP,EAEI,MAAVO,KAAoBH,EAAQC,GAAQ,CACzC,IAAIG,EAAMX,EAAMI,EAAKG,IACjBK,EAAWP,EAEf,GAAY,cAARM,GAA+B,gBAARA,GAAiC,cAARA,EAClD,OAAOR,EAGT,GAAII,GAASE,EAAW,CACtB,IAAII,EAAWH,EAAOC,QAELG,KADjBF,EAAWN,EAAaA,EAAWO,EAAUF,EAAKD,QAAUI,KAE1DF,EAAWd,EAASe,GAChBA,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JG8FC,EAC9F"}
@@ -1,2 +0,0 @@
1
- import{a as e,_ as t}from"./createClass-be661622.js";import{f as i}from"./canvas-constants-187a30d5.js";import{a as r,L as a,M as n,e as o,a1 as s,a2 as d,t as p,w as c,x as l,v as m,b as u,o as f,s as y}from"./isArrayLikeObject-6a001191.js";var h=i,b=r,g=a,v=n,_=o;var j=function(e,t,i,r){if(!v(e))return e;for(var a=-1,n=(t=b(t,e)).length,o=n-1,s=e;null!=s&&++a<n;){var d=_(t[a]),p=i;if("__proto__"===d||"constructor"===d||"prototype"===d)return e;if(a!=o){var c=s[d];void 0===(p=r?r(c,d,s):void 0)&&(p=v(c)?c:g(t[a+1])?[]:{})}h(s,d,p),s=s[d]}return e},A=function(){function i(){t(this,i)}return e(i,[{key:"do",value:function(){}},{key:"undo",value:function(){}},{key:"redo",value:function(){}},{key:"getLabel",value:function(){}}]),i}(),w=j;var q=function(e,t,i){return null==e?e:w(e,t,i)};var I=s,S=function(){},x=I&&1/d(new I([,-0]))[1]==1/0?function(e){return new I(e)}:S,M=p,k=c,$=l,D=m,F=x,L=d;var O=function(e,t,i){var r=-1,a=k,n=e.length,o=!0,s=[],d=s;if(i)o=!1,a=$;else if(n>=200){var p=t?null:F(e);if(p)return L(p);o=!1,a=D,d=new M}else d=t?[]:s;e:for(;++r<n;){var c=e[r],l=t?t(c):c;if(c=i||0!==c?c:0,o&&l==l){for(var m=d.length;m--;)if(d[m]===l)continue e;t&&d.push(l),s.push(c)}else a(d,l,i)||(d!==s&&d.push(l),s.push(c))}return s},P=u,T=O,C=y,U=f((function(e){return T(P(e,1,C,!0))}));function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}function N(e){return function(e){if(Array.isArray(e))return W(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return W(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?W(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var E={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v3-schema.json",title:"Watson Data Platform Datarecord Metadata Schema",description:"Metadata schema for datarecords in the Watson Data Platform",type:"object",definitions:{record_schema:{description:"Description of a datarecord including column types and metadata",type:"object",properties:{id:{description:"Unique identifier",type:"string"},name:{description:"Name of datarecord",type:"string"},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v3-schema.json"],type:"string"},type:{description:"Always 'struct' for datarecord schema",type:"string"},fields:{description:"Array of field definitions",type:"array",minItems:0,items:{$ref:"#/definitions/field"},uniqueItems:!0},struct_types:{description:"The list of custom struct types to be used as field types",type:"object",patternProperties:{".":{type:"object",properties:{fields:{description:"Array of field definitions",type:"array",minItems:0,items:{$ref:"#/definitions/field"},uniqueItems:!0}}}}}},required:["id","fields"]},field:{description:"Definition of a datarecord field",type:"object",properties:{name:{description:"Field name. Must be unique within the datarecord",type:"string"},type:{description:"Field type. Can be a primitive type (string, integer, double, date, time, timestamp, binary, boolean, array[type], map[type, type]. The type can also be a reference to a struct_type declaration.)",type:"string"},nullable:{description:"Whether or not one can place null values into the field",type:"boolean",default:!1},metadata:{$ref:"#/definitions/metadata"},app_data:{$ref:"#/definitions/app_data_def"}},required:["name","type"]},metadata:{description:"Additional field metadata",type:"object",properties:{description:{description:"Field description",type:"string"},measure:{description:"Field measurement level",enum:["range","discrete","flag","set","ordered-set","typeless","collection","geospatial","default"]},modeling_role:{description:"Field role for modeling",enum:["input","target","both","none","partition","split","frequency","record-id"]},max_length:{description:"Maximum length for fields. Length is unlimited when not present",type:"number"},min_length:{description:"Minimum length for fields",type:"number"},decimal_precision:{description:"Precision for decimal, time, and timestamp types",type:"number"},decimal_scale:{description:"Scale for decimal, time, and timestamp types",type:"number"},values:{description:"Array of unique categorical values for the column",type:"array",minItems:0,items:{description:"A value discovered in the data",type:["string","number","boolean"]},uniqueItems:!0},range:{description:"Minimum and maximum discovered values for scalar data",type:"object",properties:{min:{description:"Lowest value discovered in the data",type:["string","number"]},max:{description:"Highest value discovered in the data",type:["string","number"]}},required:["min","max"]},runtime_type:{description:"Type of runtime",type:"string"},is_key:{description:"A field is key",type:"boolean"},is_signed:{description:"Signed or Unsigned for number",type:"boolean"},item_index:{description:"Item record level",type:"number"},source_field_id:{description:"Source field for a target field",type:"string"}}},app_data_def:{description:"Object containing app-specific data",type:"object",properties:{},additionalProperties:!0}}};export{A,j as _,O as a,N as b,E as d,q as s,U as u};
2
- //# sourceMappingURL=datarecord-metadata-v3-schema-9e9ba30d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datarecord-metadata-v3-schema-9e9ba30d.js","sources":["../node_modules/lodash/_baseSet.js","../src/command-stack/action.js","../node_modules/lodash/set.js","../node_modules/lodash/_createSet.js","../node_modules/lodash/noop.js","../node_modules/lodash/_baseUniq.js","../node_modules/lodash/union.js","../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js"],"sourcesContent":["var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nmodule.exports = baseSet;\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 */\n\n/* eslint no-empty-function: [\"error\", { \"allow\": [\"methods\"] }] */\n\nclass Action {\n\n\t// Standard methods\n\tdo() {\n\t}\n\n\tundo() {\n\t}\n\n\tredo() {\n\t}\n\n\tgetLabel() {\n\t}\n}\n\nexport default Action;\n","var baseSet = require('./_baseSet');\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n","var baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n baseUniq = require('./_baseUniq'),\n isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nmodule.exports = union;\n","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}"],"names":["assignValue","require$$0","castPath","require$$1","isIndex","require$$2","isObject","require$$3","toKey","require$$4","_baseSet","object","path","value","customizer","index","length","lastIndex","nested","key","newValue","objValue","undefined","Action","_classCallCheck","_createClass","baseSet","set_1","Set","noop","createSet","values","SetCache","arrayIncludes","arrayIncludesWith","cacheHas","setToArray","require$$5","_baseUniq","array","iteratee","comparator","includes","isCommon","result","seen","set","outer","computed","seenIndex","push","baseFlatten","baseUniq","isArrayLikeObject","union_1","arrays","_arrayLikeToArray","arr","len","i","arr2","Array","_toConsumableArray","isArray","arrayLikeToArray","arrayWithoutHoles","iter","Symbol","iterator","from","iterableToArray","o","minLen","n","Object","prototype","toString","call","slice","constructor","name","test","unsupportedIterableToArray","TypeError","nonIterableSpread"],"mappings":"kPAAA,IAAIA,EAAcC,EACdC,EAAWC,EACXC,EAAUC,EACVC,EAAWC,EACXC,EAAQC,MA8CZC,EAlCA,SAAiBC,EAAQC,EAAMC,EAAOC,GACpC,IAAKR,EAASK,GACZ,OAAOA,EAST,IALA,IAAII,GAAS,EACTC,GAHJJ,EAAOV,EAASU,EAAMD,IAGJ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AGO,MAAM,GAAI,GAEpD,MADU,WAANL,GAAkBF,EAAEQ,cAAaN,EAAIF,EAAEQ,YAAYC,MAC7C,QAANP,GAAqB,QAANA,EAAoBZ,MAAMQ,KAAKE,GACxC,cAANE,GAAqB,2CAA2CQ,KAAKR,GAAWT,EAAiBO,EAAGC,QAAxG,EACF,CHH2DU,CAA2BzB,IILvE,WACb,MAAM,IAAI0B,UAAU,uIACtB,CJG8FC,EAC9F"}
@@ -1,2 +0,0 @@
1
- "use strict";var e=require("./isArrayLikeObject-0cd02b77.js"),t=require("./datarecord-metadata-v3-schema-36dfc3cd.js"),n=require("./createClass-826941b3.js"),r=require("./getPrototypeOf-1e698126.js"),a=require("react"),o=require("react-resize-detector"),i=require("./lib/tooltip.js"),s=require("carbon-components-react"),l=require("react-inlinesvg"),u=require("./_baseForOwn-33edf1a0.js"),c=require("@carbon/icons-react"),d=require("./canvas-constants-5fb4e9b8.js");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=f(a),C=f(o),p=f(l),b=/\s/;var v=function(e){for(var t=e.length;t--&&b.test(e.charAt(t)););return t},m=/^\s+/;var g=function(e){return e?e.slice(0,v(e)+1).replace(m,""):e},E=e.isObject_1,O=e.isSymbol_1,T=/^[-+]0x[0-9a-f]+$/i,y=/^0b[01]+$/i,I=/^0o[0-7]+$/i,A=parseInt;var _=function(e){if("number"==typeof e)return e;if(O(e))return NaN;if(E(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=E(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=g(e);var n=y.test(e);return n||I.test(e)?A(e.slice(2),n?2:8):T.test(e)?NaN:+e};function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=r._getPrototypeOf(e);if(t){var o=r._getPrototypeOf(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return r._possibleConstructorReturn(this,n)}}var B=function(e){r._inherits(a,e);var t=x(a);function a(e){var o;return n._classCallCheck(this,a),(o=t.call(this,e)).actionClickHandler=o.actionClickHandler.bind(r._assertThisInitialized(o)),o.onMouseEnter=o.onMouseEnter.bind(r._assertThisInitialized(o)),o.onMouseLeave=o.onMouseLeave.bind(r._assertThisInitialized(o)),o}return n._createClass(a,[{key:"onMouseEnter",value:function(e){(this.props.actionObj.subMenu||this.props.actionObj.subPanel)&&this.props.subMenuActionHandler(this.props.actionObj.action)}},{key:"onMouseLeave",value:function(e){(this.props.actionObj.subMenu||this.props.actionObj.subPanel)&&this.props.subMenuActionHandler("")}},{key:"getDefaultIcon",value:function(e){var t=!e.enable;switch(e.action){case d.TOOLBAR_STOP:return h.default.createElement(c.StopFilledAlt16,{disabled:t});case d.TOOLBAR_RUN:return h.default.createElement(c.Play16,{disabled:t});case d.TOOLBAR_EXPAND_SUPERNODE_IN_PLACE:return h.default.createElement(c.Maximize16,{disabled:t});case d.TOOLBAR_COLLAPSE_SUPERNODE_IN_PLACE:return h.default.createElement(c.Minimize16,{disabled:t});case d.TOOLBAR_EXPAND_SUPERNODE_FULL_PAGE:return h.default.createElement(c.Launch16,{disabled:t});case d.TOOLBAR_UNDO:return h.default.createElement(c.Undo16,{disabled:t});case d.TOOLBAR_REDO:return h.default.createElement(c.Redo16,{disabled:t});case d.TOOLBAR_CUT:return h.default.createElement(c.Cut16,{disabled:t});case d.TOOLBAR_COPY:return h.default.createElement(c.Copy16,{disabled:t});case d.TOOLBAR_PASTE:return h.default.createElement(c.Paste16,{disabled:t});case d.TOOLBAR_CREATE_COMMENT:case d.TOOLBAR_CREATE_AUTO_COMMENT:return h.default.createElement(c.AddComment16,{disabled:t});case d.TOOLBAR_SHOW_COMMENTS:return h.default.createElement(c.Chat16,{disabled:t});case d.TOOLBAR_HIDE_COMMENTS:return h.default.createElement(c.ChatOff16,{disabled:t});case d.TOOLBAR_COLOR_BACKGROUND:return h.default.createElement(c.ColorPalette16,{disabled:t});case d.TOOLBAR_DELETE_LINK:case d.TOOLBAR_DELETE_SELECTED_OBJECTS:return h.default.createElement(c.TrashCan16,{disabled:t});case d.TOOLBAR_SET_COMMENT_EDIT_MODE:case d.TOOLBAR_SET_NODE_LABEL_EDIT:return h.default.createElement(c.Edit16,{disabled:t});case d.TOOLBAR_ZOOM_IN:return h.default.createElement(c.ZoomIn16,{disabled:t});case d.TOOLBAR_ZOOM_OUT:return h.default.createElement(c.ZoomOut16,{disabled:t});case d.TOOLBAR_ZOOM_FIT:return h.default.createElement(p.default,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22currentColor%22%3E%20%3Cpath%20d%3D%22M6%2C7.5h4v1H6Z%22%2F%3E%20%3Cpath%20d%3D%22M4%2C12h8a.94.94%2C0%2C0%2C0%2C1-1V5a.94.94%2C0%2C0%2C0-1-1H4A.94.94%2C0%2C0%2C0%2C3%2C5v6A.94.94%2C0%2C0%2C0%2C4%2C12ZM4%2C5h8v6H4Z%22%2F%3E%20%3Cpolygon%20points%3D%222%203.5%201%203.5%201%201%203.5%201%203.5%202%202%202%202%203.5%22%2F%3E%20%3Cpolygon%20points%3D%2215%203.5%2014%203.5%2014%202%2012.5%202%2012.5%201%2015%201%2015%203.5%22%2F%3E%20%3Cpolygon%20points%3D%2215%2015%2012.5%2015%2012.5%2014%2014%2014%2014%2012.5%2015%2012.5%2015%2015%22%2F%3E%20%3Cpolygon%20points%3D%223.5%2015%201%2015%201%2012.5%202%2012.5%202%2014%203.5%2014%203.5%2015%22%2F%3E%3C%2Fsvg%3E",disabled:t});case d.TOOLBAR_ARRANGE_HORIZONALLY:return h.default.createElement(p.default,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20x%3D%221.5%22%20y%3D%222%22%20width%3D%2213%22%20height%3D%221%22%2F%3E%3Crect%20x%3D%221.5%22%20y%3D%2213%22%20width%3D%2213%22%20height%3D%221%22%2F%3E%3Cpath%20d%3D%22M7%2C10.5H2a.47.47%2C0%2C0%2C1-.5-.5V6A.47.47%2C0%2C0%2C1%2C2%2C5.5H7a.47.47%2C0%2C0%2C1%2C.5.5v4A.47.47%2C0%2C0%2C1%2C7%2C10.5Zm-4.5-1h4v-3h-4Z%22%2F%3E%3Cpath%20d%3D%22M14%2C10.5H9a.47.47%2C0%2C0%2C1-.5-.5V6A.47.47%2C0%2C0%2C1%2C9%2C5.5h5a.47.47%2C0%2C0%2C1%2C.5.5v4A.47.47%2C0%2C0%2C1%2C14%2C10.5Zm-4.5-1h4v-3h-4Z%22%2F%3E%3C%2Fsvg%3E",disabled:t});case d.TOOLBAR_ARRANGE_VERTICALLY:return h.default.createElement(p.default,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20x%3D%222%22%20y%3D%221.5%22%20width%3D%221%22%20height%3D%2213%22%2F%3E%3Crect%20x%3D%2213%22%20y%3D%221.5%22%20width%3D%221%22%20height%3D%2213%22%2F%3E%3Cpath%20d%3D%22M10.5%2C7.5h-5A.47.47%2C0%2C0%2C1%2C5%2C7V3a.47.47%2C0%2C0%2C1%2C.5-.5h5A.47.47%2C0%2C0%2C1%2C11%2C3V7A.47.47%2C0%2C0%2C1%2C10.5%2C7.5ZM6%2C6.5h4v-3H6Z%22%2F%3E%3Cpath%20d%3D%22M10.5%2C13.5h-5A.47.47%2C0%2C0%2C1%2C5%2C13V9a.47.47%2C0%2C0%2C1%2C.5-.5h5A.47.47%2C0%2C0%2C1%2C11%2C9v4A.47.47%2C0%2C0%2C1%2C10.5%2C13.5ZM6%2C12.5h4v-3H6Z%22%2F%3E%3C%2Fsvg%3E",disabled:t});case d.TOOLBAR_OPEN_PALETTE:return h.default.createElement(p.default,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22currentColor%22%3E%20%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22none%22%2F%3E%20%3Cpath%20d%3D%22M28%2C4H4A2%2C2%2C0%2C0%2C0%2C2%2C6V26a2%2C2%2C0%2C0%2C0%2C2%2C2H28a2%2C2%2C0%2C0%2C0%2C2-2V6A2%2C2%2C0%2C0%2C0%2C28%2C4Zm0%2C22H12V17.1h8.9l-2.5%2C2.5%2C1.5%2C1.5L25%2C16l-5.1-5.1-1.5%2C1.5%2C2.5%2C2.5H12V6H28Z%22%2F%3E%3C%2Fsvg%3E",disabled:t});case d.TOOLBAR_CLOSE_PALETTE:return h.default.createElement(p.default,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22currentColor%22%3E%20%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22none%22%2F%3E%20%3Cpath%20d%3D%22M28%2C4H4A2%2C2%2C0%2C0%2C0%2C2%2C6V26a2%2C2%2C0%2C0%2C0%2C2%2C2H28a2%2C2%2C0%2C0%2C0%2C2-2V6A2%2C2%2C0%2C0%2C0%2C28%2C4Zm0%2C11H19.1l2.5-2.5L20.1%2C11%2C15%2C16l5.1%2C5.1%2C1.5-1.5-2.5-2.5H28V26H12V6H28Z%22%2F%3E%3C%2Fsvg%3E",disabled:t});case d.TOOLBAR_TOGGLE_NOTIFICATION_PANEL:return h.default.createElement(p.default,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22currentColor%22%3E%20%3Cpath%20d%3D%22M27%2C12V27H5V5H20V3H5A2%2C2%2C0%2C0%2C0%2C3%2C5V27a2%2C2%2C0%2C0%2C0%2C2%2C2H27a2%2C2%2C0%2C0%2C0%2C2-2V12Z%22%2F%3E%20%3Ccircle%20class%3D%22dot%22%20cx%3D%2226.5%22%20cy%3D%225.5%22%20r%3D%223.5%22%2F%3E%3C%2Fsvg%3E",disabled:t});default:return null}}},{key:"generateLabel",value:function(e,t,n,r){var a="toolbar-icon-label";return a+=this.generateLabelType(n,r),a+=t?" disabled":"",h.default.createElement("div",{className:a},e)}},{key:"generateLabelType",value:function(e,t){return e?" overflow":"before"===t?" before":"after"===t?" after":""}},{key:"generateIcon",value:function(e){var t=this.getDefaultIcon(e);if(e.iconEnabled){var n=e.iconEnabled,r=e.iconDisabled||e.iconEnabled,a=e.enable?n:r,o="toolbar-icon-"+this.props.instanceId+" -"+e.action;t="string"==typeof a?h.default.createElement(p.default,{id:o,src:a,disabled:!e.enable}):a}return t?h.default.createElement("div",{className:"toolbar-icon"},t):null}},{key:"actionClickHandler",value:function(e){this.props.actionObj.subMenu||this.props.actionObj.subPanel||this.props.toolbarActionHandler(this.props.actionObj.action,e)}},{key:"generateButton",value:function(e){var t=null,n=null;this.props.overflow?n=this.generateLabel(e.label,!e.enable,!0):"before"===e.incLabelWithIcon?t=this.generateLabel(e.label,!e.enable,!1,e.incLabelWithIcon):"after"===e.incLabelWithIcon&&(n=this.generateLabel(e.label,!e.enable,!1,e.incLabelWithIcon));var r=this.generateIcon(e),a=e.textContent?h.default.createElement("div",{className:"toolbar-text-content"}," ",e.textContent," "):null,o=u.classNames("toolbar-item-content",e.className?e.className:null,{overflow:this.props.overflow,disabled:!e.enable,default:!e.kind}),i=e.kind||"ghost",l=e.subMenu||this.props.actionObj.subPanel?h.default.createElement(c.ChevronRight16,null):null,d=h.default.createElement("div",{className:o},t,r,n,a,l);d=this.wrapInTooltip(d);var f=e.incLabelWithIcon?null:e.label;return d=h.default.createElement(s.Button,{kind:i,onClick:this.actionClickHandler,disabled:!e.enable,onFocus:this.props.onFocus,"aria-label":f,size:this.props.size},d)}},{key:"generateActionName",value:function(e){return this.props.actionObj.action+"-action"}},{key:"wrapInTooltip",value:function(e){if(!this.props.overflow&&(this.showLabelAsTip(this.props.actionObj)||this.props.actionObj.tooltip)){var t=this.generateActionName(),n=this.props.actionObj.tooltip?this.props.actionObj.tooltip:this.props.actionObj.label,r=t+"-"+this.props.instanceId+"-tooltip",a=this.props.actionObj.enable||this.props.actionObj.jsx,o=this.props.tooltipDirection?this.props.tooltipDirection:"bottom";return h.default.createElement(i,{id:r,tip:n,disable:!a,className:"icon-tooltip",direction:o},e)}return e}},{key:"showLabelAsTip",value:function(e){return!!e.label&&("before"!==e.incLabelWithIcon&&"after"!==e.incLabelWithIcon)}},{key:"generateSubArea",value:function(){if(this.props.displaySubArea){var e=this.calcSubAreaStyle();if(this.props.actionObj.subPanel)return h.default.createElement("div",{style:e,className:"toolbar-popover-list subpanel"},this.props.actionObj.subPanel);var t=this.props.generateToolbarItems(this.props.actionObj.subMenu,!0,!1);return h.default.createElement("div",{style:e,className:"toolbar-popover-list submenu"},t)}return null}},{key:"calcSubAreaStyle",value:function(){var e=this.generateActionName(),t=document.getElementsByClassName(e),n=t&&t.length>0?t[0].getBoundingClientRect():{top:0,left:0,width:120};return{top:n.top-1,left:n.left+n.width}}},{key:"render",value:function(){var e=this.props.actionObj,t=this.generateActionName(),n=null;n=e.jsx?this.wrapInTooltip(e.jsx):this.generateButton(e);var r=!this.props.overflow||null,a=e.kind?e.kind:"default",o=u.classNames({"toolbar-overflow-menu-item":this.props.overflow,"toolbar-item":!this.props.overflow&&!e.jsx,"toolbar-jsx-item":!this.props.overflow&&e.jsx,"toolbar-overflow-jsx-item":this.props.overflow&&e.jsx,"toolbar-item-selected":e.isSelected},a,t),i=this.generateSubArea();return h.default.createElement("div",{className:o,"data-toolbar-item":r,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},n,i)}}]),a}(h.default.Component);function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=r._getPrototypeOf(e);if(t){var o=r._getPrototypeOf(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return r._possibleConstructorReturn(this,n)}}var w=function(e){r._inherits(a,e);var t=R(a);function a(e){var o;return n._classCallCheck(this,a),(o=t.call(this,e)).toggleExtendedMenu=o.toggleExtendedMenu.bind(r._assertThisInitialized(o)),o}return n._createClass(a,[{key:"toggleExtendedMenu",value:function(){this.props.toggleExtendedMenu(this.props.index)}},{key:"render",value:function(){var e=null;if(this.props.showExtendedMenu){var t=this.props.generateExtensionMenuItems(this.props.index);t.length>0&&(e=h.default.createElement("div",{className:"toolbar-popover-list"},t))}var n="toolbar-spacer toolbar-index-"+this.props.index;return h.default.createElement("div",{className:n},h.default.createElement("div",{className:"toolbar-overflow-item"},h.default.createElement(s.Button,{kind:"ghost",tabIndex:-1,onClick:this.toggleExtendedMenu,onFocus:this.props.onFocus,"aria-label":this.props.label,size:this.props.size},h.default.createElement("div",{className:"toolbar-item-content default"},h.default.createElement("div",{className:"toolbar-icon"},h.default.createElement(c.OverflowMenuVertical16,null))))),e)}}]),a}(h.default.Component);function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=r._getPrototypeOf(e);if(t){var o=r._getPrototypeOf(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return r._possibleConstructorReturn(this,n)}}var L=function(e){r._inherits(a,e);var t=D(a);function a(){return n._classCallCheck(this,a),t.apply(this,arguments)}return n._createClass(a,[{key:"render",value:function(){var e=this.props.overflow?"toolbar-divider-overflow":"toolbar-divider";return h.default.createElement("div",{className:e,"data-toolbar-item":!0,tabIndex:-1,"aria-hidden":!0}," ")}}]),a}(h.default.Component);function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=r._getPrototypeOf(e);if(t){var o=r._getPrototypeOf(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return r._possibleConstructorReturn(this,n)}}var F=function(e){r._inherits(o,e);var a=M(o);function o(e){var t;return n._classCallCheck(this,o),(t=a.call(this,e)).state={showExtendedMenuIndex:-1,subAreaDisplayedForAction:""},t.leftBar=[],t.rightBar=[],t.onFocus=t.onFocus.bind(r._assertThisInitialized(t)),t.onToolbarResize=t.onToolbarResize.bind(r._assertThisInitialized(t)),t.toggleExtendedMenu=t.toggleExtendedMenu.bind(r._assertThisInitialized(t)),t.generateExtensionMenuItems=t.generateExtensionMenuItems.bind(r._assertThisInitialized(t)),t.generateToolbarItems=t.generateToolbarItems.bind(r._assertThisInitialized(t)),t.subMenuActionHandler=t.subMenuActionHandler.bind(r._assertThisInitialized(t)),t}return n._createClass(o,[{key:"onFocus",value:function(){this.setLeftBarItemsTabIndex(),this.setRightBarItemsTabIndex()}},{key:"onScroll",value:function(e){e.currentTarget.scroll(0,0),e.preventDefault()}},{key:"onToolbarResize",value:function(){this.state.showExtendedMenuIndex>-1&&this.setState({showExtendedMenuIndex:-1}),this.setLeftBarItemsTabIndex(),this.setRightBarItemsTabIndex()}},{key:"setLeftBarItemsTabIndex",value:function(){var e=this.getBar("left");if(e){for(var t=e.querySelectorAll("[data-toolbar-item=true]")||[],n=this.getTopOfFirstOverflowItem(e),r=-1,a=0;a<t.length;a++){var o=t[a].getBoundingClientRect();this.setOverflowItemButtonTabIndex(a,-1,e),o.top===n?(r=a,this.setToolbarItemButtonTabIndex(t[a],0)):this.setToolbarItemButtonTabIndex(t[a],-1)}r<t.length&&this.setOverflowItemButtonTabIndex(r+1,0,e)}}},{key:"setRightBarItemsTabIndex",value:function(){for(var e=this.getRightBarItems(),t=0,n=0;n<e.length;n++){var r=e[n].getBoundingClientRect();0===n&&(t=r.top),r.top===t?this.setToolbarItemButtonTabIndex(e[n],0):this.setToolbarItemButtonTabIndex(e[n],-1)}}},{key:"getBar",value:function(e){var t=this.props.instanceId;return document.querySelector(".toolbar-div[instanceid='".concat(t,"'] > .toolbar-").concat(e,"-bar"))||[]}},{key:"getRightBarItems",value:function(){var e=this.getBar("right");return e&&e.querySelectorAll("[data-toolbar-item=true]")||[]}},{key:"getTopOfFirstOverflowItem",value:function(e){var t=this.getOverflowItem(0,e);return t?t.getBoundingClientRect().top:0}},{key:"getOverflowItem",value:function(e,t){var n="toolbar-index-"+e;return t.getElementsByClassName(n)[0]}},{key:"setToolbarItemButtonTabIndex",value:function(e,t){var n=e.querySelector("button");n&&n.setAttribute("tabindex",t)}},{key:"setOverflowItemButtonTabIndex",value:function(e,t,n){var r=this.getOverflowItem(e,n);if(r){var a=r.querySelector("button");a&&a.setAttribute("tabindex",t)}}},{key:"subMenuActionHandler",value:function(e){this.setState({subAreaDisplayedForAction:e})}},{key:"generateToolbarItems",value:function(e,t,n){for(var r=[],a=0;a<e.length;a++){var o=e[a];o&&(n&&!o.divider&&r.push(this.generateOverflowIcon(a)),r.push(this.generateToolbarItem(o,a,t)))}return r}},{key:"generateToolbarItem",value:function(e,t,n){var r=null;if(e)if(e.divider)r=h.default.createElement(L,{key:"toolbar-item-key-"+t,overflow:n});else{var a=n&&this.state.subAreaDisplayedForAction===e.action;r=h.default.createElement(B,{key:"toolbar-item-key-"+t,actionObj:e,tooltipDirection:this.props.tooltipDirection,toolbarActionHandler:this.props.toolbarActionHandler,subMenuActionHandler:this.subMenuActionHandler,generateToolbarItems:this.generateToolbarItems,displaySubArea:a,overflow:n,instanceId:this.props.instanceId,onFocus:this.onFocus,size:this.props.size})}return r}},{key:"generateOverflowIcon",value:function(e){var t=this.props.additionalText?this.props.additionalText.overflowMenuLabel:"";return h.default.createElement(w,{key:"toolbar-overflow-item-key-"+e,index:e,showExtendedMenu:this.state.showExtendedMenuIndex===e,toggleExtendedMenu:this.toggleExtendedMenu,generateExtensionMenuItems:this.generateExtensionMenuItems,onFocus:this.onFocus,label:t,size:this.props.size})}},{key:"generateExtensionMenuItems",value:function(e){var t=this.generateRightOverflowItems();t.reverse();var n=this.leftBar.slice(e).concat(t);return this.generateToolbarItems(n,!0,!1)}},{key:"generateRightOverflowItems",value:function(){for(var e=[],t=this.getRightBarItems(),n=0,r=0;r<t.length;r++){var a=t[r].getBoundingClientRect();0===r&&(n=a.top),a.top!==n&&e.push(this.rightBar[r])}return e}},{key:"toggleExtendedMenu",value:function(e){var t=e===this.state.showExtendedMenuIndex?-1:e;this.setState({showExtendedMenuIndex:t})}},{key:"render",value:function(){this.leftBar=this.props.config.leftBar||[],this.rightBar=this.props.config.rightBar||[],this.rightBar=t._toConsumableArray(this.rightBar).reverse()||[];var e=this.generateToolbarItems(this.leftBar,!1,!0),n=this.generateToolbarItems(this.rightBar,!1,!1),r="sm"===this.props.size?"toolbar-div toolbar-size-small":"toolbar-div";return h.default.createElement(C.default,{handleWidth:!0,onResize:this.onToolbarResize},h.default.createElement("div",{className:r,instanceid:this.props.instanceId},h.default.createElement("div",{className:"toolbar-left-bar",onScroll:this.onScroll},e),h.default.createElement("div",{className:"toolbar-right-bar"},n)))}}]),o}(h.default.Component);exports.Toolbar=F,exports.toNumber_1=_;
2
- //# sourceMappingURL=toolbar-3affe026.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toolbar-3affe026.js","sources":["../node_modules/lodash/_trimmedEndIndex.js","../node_modules/lodash/_baseTrim.js","../node_modules/lodash/toNumber.js","../src/toolbar/toolbar-action-item.jsx","../assets/images/zoom_to_fit.svg","../assets/images/arrange_horizontally.svg","../assets/images/arrange_vertically.svg","../assets/images/palette/palette_open.svg","../assets/images/palette/palette_close.svg","../assets/images/notification_counter_icon.svg","../src/toolbar/toolbar-overflow-item.jsx","../src/toolbar/toolbar-divider-item.jsx","../src/toolbar/toolbar.jsx"],"sourcesContent":["/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\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 */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport Tooltip from \"../tooltip/tooltip.jsx\";\nimport ArrangeHorizontally from \"./../../assets/images/arrange_horizontally.svg\";\nimport ArrangeVertically from \"./../../assets/images/arrange_vertically.svg\";\nimport ToggleNotificationPanel from \"./../../assets/images/notification_counter_icon.svg\";\nimport PaletteClose from \"./../../assets/images/palette/palette_close.svg\";\nimport PaletteOpen from \"./../../assets/images/palette/palette_open.svg\";\nimport ZoomToFit from \"./../../assets/images/zoom_to_fit.svg\";\n\nimport { Button } from \"carbon-components-react\";\nimport SVG from \"react-inlinesvg\";\nimport classNames from \"classnames\";\nimport { StopFilledAlt16, Play16, Undo16, Redo16, Chat16, ChatOff16,\n\tCut16, Copy16, Paste16, Edit16,\tColorPalette16, Maximize16, Minimize16,\n\tLaunch16, AddComment16, TrashCan16, ZoomIn16, ZoomOut16, ChevronRight16 } from \"@carbon/icons-react\";\nimport { TOOLBAR_STOP, TOOLBAR_RUN, TOOLBAR_UNDO, TOOLBAR_REDO,\n\tTOOLBAR_CUT, TOOLBAR_COPY, TOOLBAR_PASTE,\n\tTOOLBAR_CREATE_COMMENT, TOOLBAR_CREATE_AUTO_COMMENT, TOOLBAR_COLOR_BACKGROUND,\n\tTOOLBAR_DELETE_SELECTED_OBJECTS, TOOLBAR_DELETE_LINK,\n\tTOOLBAR_ZOOM_IN, TOOLBAR_ZOOM_OUT, TOOLBAR_ZOOM_FIT,\n\tTOOLBAR_ARRANGE_HORIZONALLY, TOOLBAR_ARRANGE_VERTICALLY,\n\tTOOLBAR_OPEN_PALETTE, TOOLBAR_CLOSE_PALETTE, TOOLBAR_TOGGLE_NOTIFICATION_PANEL,\n\tTOOLBAR_SHOW_COMMENTS, TOOLBAR_HIDE_COMMENTS,\n\tTOOLBAR_EXPAND_SUPERNODE_IN_PLACE, TOOLBAR_COLLAPSE_SUPERNODE_IN_PLACE,\n\tTOOLBAR_EXPAND_SUPERNODE_FULL_PAGE, TOOLBAR_SET_NODE_LABEL_EDIT, TOOLBAR_SET_COMMENT_EDIT_MODE }\n\tfrom \"../common-canvas/constants/canvas-constants.js\";\n\nclass ToolbarActionItem extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.actionClickHandler = this.actionClickHandler.bind(this);\n\t\tthis.onMouseEnter = this.onMouseEnter.bind(this);\n\t\tthis.onMouseLeave = this.onMouseLeave.bind(this);\n\t}\n\n\tonMouseEnter(evt) {\n\t\tif (this.props.actionObj.subMenu || this.props.actionObj.subPanel) {\n\t\t\tthis.props.subMenuActionHandler(this.props.actionObj.action);\n\t\t}\n\t}\n\n\tonMouseLeave(evt) {\n\t\tif (this.props.actionObj.subMenu || this.props.actionObj.subPanel) {\n\t\t\tthis.props.subMenuActionHandler(\"\");\n\t\t}\n\t}\n\n\t// Returns a default icon, if there is one, for the action passed in.\n\t// It also may be set to disabled state.\n\tgetDefaultIcon(actionObj) {\n\t\tconst disabled = !actionObj.enable;\n\n\t\tswitch (actionObj.action) {\n\t\tcase (TOOLBAR_STOP):\n\t\t\treturn <StopFilledAlt16 disabled={disabled} />;\n\t\tcase (TOOLBAR_RUN):\n\t\t\treturn <Play16 disabled={disabled} />;\n\t\tcase (TOOLBAR_EXPAND_SUPERNODE_IN_PLACE):\n\t\t\treturn <Maximize16 disabled={disabled} />;\n\t\tcase (TOOLBAR_COLLAPSE_SUPERNODE_IN_PLACE):\n\t\t\treturn <Minimize16 disabled={disabled} />;\n\t\tcase (TOOLBAR_EXPAND_SUPERNODE_FULL_PAGE):\n\t\t\treturn <Launch16 disabled={disabled} />;\n\t\tcase (TOOLBAR_UNDO):\n\t\t\treturn <Undo16 disabled={disabled} />;\n\t\tcase (TOOLBAR_REDO):\n\t\t\treturn <Redo16 disabled={disabled} />;\n\t\tcase (TOOLBAR_CUT):\n\t\t\treturn <Cut16 disabled={disabled} />;\n\t\tcase (TOOLBAR_COPY):\n\t\t\treturn <Copy16 disabled={disabled} />;\n\t\tcase (TOOLBAR_PASTE):\n\t\t\treturn <Paste16 disabled={disabled} />;\n\t\tcase (TOOLBAR_CREATE_COMMENT):\n\t\tcase (TOOLBAR_CREATE_AUTO_COMMENT):\n\t\t\treturn <AddComment16 disabled={disabled} />;\n\t\tcase (TOOLBAR_SHOW_COMMENTS):\n\t\t\treturn <Chat16 disabled={disabled} />;\n\t\tcase (TOOLBAR_HIDE_COMMENTS):\n\t\t\treturn <ChatOff16 disabled={disabled} />;\n\t\tcase (TOOLBAR_COLOR_BACKGROUND):\n\t\t\treturn <ColorPalette16 disabled={disabled} />;\n\t\tcase (TOOLBAR_DELETE_LINK):\n\t\tcase (TOOLBAR_DELETE_SELECTED_OBJECTS):\n\t\t\treturn <TrashCan16 disabled={disabled} />;\n\t\tcase (TOOLBAR_SET_COMMENT_EDIT_MODE):\n\t\tcase (TOOLBAR_SET_NODE_LABEL_EDIT):\n\t\t\treturn <Edit16 disabled={disabled} />;\n\t\tcase (TOOLBAR_ZOOM_IN):\n\t\t\treturn <ZoomIn16 disabled={disabled} />;\n\t\tcase (TOOLBAR_ZOOM_OUT):\n\t\t\treturn <ZoomOut16 disabled={disabled} />;\n\n\t\tcase (TOOLBAR_ZOOM_FIT):\n\t\t\treturn <SVG src={ZoomToFit} disabled={disabled} />;\n\t\tcase (TOOLBAR_ARRANGE_HORIZONALLY):\n\t\t\treturn <SVG src={ArrangeHorizontally} disabled={disabled} />;\n\t\tcase (TOOLBAR_ARRANGE_VERTICALLY):\n\t\t\treturn <SVG src={ArrangeVertically} disabled={disabled} />;\n\t\tcase (TOOLBAR_OPEN_PALETTE):\n\t\t\treturn <SVG src={PaletteOpen} disabled={disabled} />;\n\t\tcase (TOOLBAR_CLOSE_PALETTE):\n\t\t\treturn <SVG src={PaletteClose} disabled={disabled} />;\n\t\tcase (TOOLBAR_TOGGLE_NOTIFICATION_PANEL):\n\t\t\treturn <SVG src={ToggleNotificationPanel} disabled={disabled} />;\n\n\t\tdefault:\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tgenerateLabel(label, disable, overflow, incLabelWithIcon) {\n\t\tlet className = \"toolbar-icon-label\";\n\t\tclassName += this.generateLabelType(overflow, incLabelWithIcon);\n\t\tclassName += disable ? \" disabled\" : \"\";\n\t\treturn (<div className={className}>{label}</div>);\n\t}\n\n\tgenerateLabelType(overflow, inLabelWithIcon) {\n\t\tif (overflow) {\n\t\t\treturn \" overflow\";\n\t\t} else if (inLabelWithIcon === \"before\") {\n\t\t\treturn \" before\";\n\t\t} else if (inLabelWithIcon === \"after\") {\n\t\t\treturn \" after\";\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tgenerateIcon(actionObj) {\n\t\tlet icon = this.getDefaultIcon(actionObj);\n\n\t\t// Host application provided icon. This will override any default icon.\n\t\tif (actionObj.iconEnabled) {\n\t\t\tconst iconEnabled = actionObj.iconEnabled;\n\t\t\tconst iconDisabled = actionObj.iconDisabled || actionObj.iconEnabled;\n\t\t\tconst customIcon = actionObj.enable ? iconEnabled : iconDisabled;\n\t\t\tconst id = \"toolbar-icon-\" + this.props.instanceId + \" -\" + actionObj.action;\n\n\t\t\tif (typeof customIcon === \"string\") {\n\t\t\t\ticon = (<SVG id={id} src={customIcon} disabled={!actionObj.enable} />);\n\t\t\t} else {\n\t\t\t\ticon = customIcon;\n\t\t\t}\n\t\t}\n\n\t\tif (icon) {\n\t\t\treturn (\n\t\t\t\t<div className={\"toolbar-icon\"}>\n\t\t\t\t\t{icon}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n\n\tactionClickHandler(evt) {\n\t\tif (!this.props.actionObj.subMenu && !this.props.actionObj.subPanel) {\n\t\t\tthis.props.toolbarActionHandler(this.props.actionObj.action, evt);\n\t\t}\n\t}\n\n\tgenerateButton(actionObj) {\n\t\tlet labelBefore = null;\n\t\tlet labelAfter = null;\n\n\t\tif (this.props.overflow) {\n\t\t\tlabelAfter = this.generateLabel(actionObj.label, !actionObj.enable, true);\n\n\t\t} else if (actionObj.incLabelWithIcon === \"before\") {\n\t\t\tlabelBefore = this.generateLabel(actionObj.label, !actionObj.enable, false, actionObj.incLabelWithIcon);\n\n\t\t} else if (actionObj.incLabelWithIcon === \"after\") {\n\t\t\tlabelAfter = this.generateLabel(actionObj.label, !actionObj.enable, false, actionObj.incLabelWithIcon);\n\t\t}\n\n\t\tconst icon = this.generateIcon(actionObj);\n\t\tconst textContent = actionObj.textContent ? (<div className=\"toolbar-text-content\"> {actionObj.textContent} </div>) : null;\n\n\t\tconst itemContentClassName = classNames(\n\t\t\t\"toolbar-item-content\",\n\t\t\tactionObj.className ? actionObj.className : null,\n\t\t\t{ \"overflow\": this.props.overflow, \"disabled\": !actionObj.enable, \"default\": !actionObj.kind });\n\n\t\t// If no 'kind' is set, use ghost and then override colors using the \"default\" class in innerDivClassName.\n\t\tconst kind = actionObj.kind || \"ghost\";\n\n\t\tconst chevronIcon = actionObj.subMenu || this.props.actionObj.subPanel ? (<ChevronRight16 />) : null;\n\n\t\tlet buttonContent = (\n\t\t\t<div className={itemContentClassName}>\n\t\t\t\t{labelBefore}\n\t\t\t\t{icon}\n\t\t\t\t{labelAfter}\n\t\t\t\t{textContent}\n\t\t\t\t{chevronIcon}\n\t\t\t</div>\n\t\t);\n\n\t\tbuttonContent = this.wrapInTooltip(buttonContent);\n\n\t\t// Only specify an aria label for the button if a label is not displayed\n\t\t// with the button icon.\n\t\tconst ariaLabel = actionObj.incLabelWithIcon ? null : actionObj.label;\n\n\t\tbuttonContent = (\n\t\t\t<Button kind={kind}\n\t\t\t\tonClick={this.actionClickHandler}\n\t\t\t\tdisabled={!actionObj.enable}\n\t\t\t\tonFocus={this.props.onFocus}\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\tsize={this.props.size}\n\t\t\t>\n\t\t\t\t{buttonContent}\n\t\t\t</Button>\n\t\t);\n\n\t\treturn buttonContent;\n\t}\n\n\tgenerateActionName(actionObj) {\n\t\treturn this.props.actionObj.action + \"-action\";\n\t}\n\n\twrapInTooltip(content) {\n\t\tif (!this.props.overflow && (this.showLabelAsTip(this.props.actionObj) || this.props.actionObj.tooltip)) {\n\t\t\tconst actionName = this.generateActionName();\n\t\t\tconst tip = this.props.actionObj.tooltip ? this.props.actionObj.tooltip : this.props.actionObj.label;\n\t\t\tconst tooltipId = actionName + \"-\" + this.props.instanceId + \"-tooltip\";\n\t\t\tconst enableTooltip = this.props.actionObj.enable || this.props.actionObj.jsx; // JSX 'tools' don't have enable attr so always display a tooltip for them.\n\t\t\tconst direction = this.props.tooltipDirection ? this.props.tooltipDirection : \"bottom\";\n\n\t\t\treturn (\n\t\t\t\t<Tooltip id={tooltipId} tip={tip} disable={!enableTooltip} className=\"icon-tooltip\" direction={direction}>\n\t\t\t\t\t{content}\n\t\t\t\t</Tooltip>\n\t\t\t);\n\t\t}\n\t\treturn content;\n\t}\n\n\t// Returns true if the label should be shown as a tooltip or false if not.\n\t// We do not show the label as a tooltip if it is already shown in the\n\t// toolbar next to the icon (i.e. incLabelWithIcon is set to something).\n\tshowLabelAsTip(actionObj) {\n\t\tif (actionObj.label) {\n\t\t\tif (actionObj.incLabelWithIcon === \"before\" ||\n\t\t\t\t\tactionObj.incLabelWithIcon === \"after\") {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// Returns a sub-area for a cascading menu item. The sub-area can be either a\n\t// sub-panel which is a div contaiing whatever the caller passes in within the\n\t// supPanel field OR a sub-menu which is a list of options which is created\n\t// from the array of items the caller passes in the subMenu field.\n\tgenerateSubArea() {\n\t\tif (this.props.displaySubArea) {\n\t\t\tconst style = this.calcSubAreaStyle();\n\n\t\t\tif (this.props.actionObj.subPanel) {\n\t\t\t\treturn (\n\t\t\t\t\t<div style={style} className={\"toolbar-popover-list subpanel\"}>\n\t\t\t\t\t\t{this.props.actionObj.subPanel}\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst subMenuItems = this.props.generateToolbarItems(this.props.actionObj.subMenu, true, false);\n\n\t\t\treturn (\n\t\t\t\t<div style={style} className={\"toolbar-popover-list submenu\"}>\n\t\t\t\t\t{subMenuItems}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tcalcSubAreaStyle() {\n\t\tconst className = this.generateActionName();\n\t\tconst elements = document.getElementsByClassName(className);\n\t\tconst rect = elements && elements.length > 0 ? elements[0].getBoundingClientRect() : { top: 0, left: 0, width: 120 };\n\t\tconst style = { top: rect.top - 1, left: rect.left + rect.width };\n\t\treturn style;\n\t}\n\n\trender() {\n\t\tconst actionObj = this.props.actionObj;\n\t\tconst actionName = this.generateActionName();\n\t\tlet divContent = null;\n\n\t\tif (actionObj.jsx) {\n\t\t\tdivContent = this.wrapInTooltip(actionObj.jsx);\n\t\t} else {\n\t\t\tdivContent = this.generateButton(actionObj);\n\t\t}\n\n\t\tconst isToolbarItem = this.props.overflow ? null : true; // null wil make data-toolbar-item be removed\n\t\tconst kindAsClass = actionObj.kind ? actionObj.kind : \"default\";\n\n\t\tconst itemClassName = classNames(\n\t\t\t{ \"toolbar-overflow-menu-item\": this.props.overflow,\n\t\t\t\t\"toolbar-item\": !this.props.overflow && !actionObj.jsx,\n\t\t\t\t\"toolbar-jsx-item\": !this.props.overflow && actionObj.jsx,\n\t\t\t\t\"toolbar-overflow-jsx-item\": this.props.overflow && actionObj.jsx,\n\t\t\t\t\"toolbar-item-selected\": actionObj.isSelected },\n\t\t\tkindAsClass,\n\t\t\tactionName);\n\n\t\tconst subArea = this.generateSubArea();\n\n\t\treturn (\n\t\t\t<div className={itemClassName} data-toolbar-item={isToolbarItem} onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}>\n\t\t\t\t{divContent}\n\t\t\t\t{subArea}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nToolbarActionItem.propTypes = {\n\tactionObj: PropTypes.shape({\n\t\taction: PropTypes.string.isRequired,\n\t\tlabel: PropTypes.oneOfType([\n\t\t\tPropTypes.string,\n\t\t\tPropTypes.object\n\t\t]),\n\t\tincLabelWithIcon: PropTypes.oneOf([\"no\", \"before\", \"after\"]),\n\t\tenable: PropTypes.bool,\n\t\ticonEnabled: PropTypes.oneOfType([\n\t\t\tPropTypes.string,\n\t\t\tPropTypes.object\n\t\t]),\n\t\ticonDisabled: PropTypes.oneOfType([\n\t\t\tPropTypes.string,\n\t\t\tPropTypes.object\n\t\t]),\n\t\tclassName: PropTypes.string,\n\t\ttextContent: PropTypes.string,\n\t\tisSelected: PropTypes.bool,\n\t\tkind: PropTypes.string,\n\t\tsubMenu: PropTypes.array,\n\t\tsubPanel: PropTypes.object,\n\t\tjsx: PropTypes.object,\n\t\ttooltip: PropTypes.oneOfType([\n\t\t\tPropTypes.string,\n\t\t\tPropTypes.object,\n\t\t\tPropTypes.func\n\t\t])\n\t}),\n\ttooltipDirection: PropTypes.oneOf([\"top\", \"bottom\"]),\n\ttoolbarActionHandler: PropTypes.func.isRequired,\n\tsubMenuActionHandler: PropTypes.func.isRequired,\n\tgenerateToolbarItems: PropTypes.func.isRequired,\n\tinstanceId: PropTypes.number.isRequired,\n\tdisplaySubArea: PropTypes.bool,\n\toverflow: PropTypes.bool,\n\tonFocus: PropTypes.func,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"])\n};\n\nexport default ToolbarActionItem;\n","export default \"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22currentColor%22%3E%20%3Cpath%20d%3D%22M6%2C7.5h4v1H6Z%22%2F%3E%20%3Cpath%20d%3D%22M4%2C12h8a.94.94%2C0%2C0%2C0%2C1-1V5a.94.94%2C0%2C0%2C0-1-1H4A.94.94%2C0%2C0%2C0%2C3%2C5v6A.94.94%2C0%2C0%2C0%2C4%2C12ZM4%2C5h8v6H4Z%22%2F%3E%20%3Cpolygon%20points%3D%222%203.5%201%203.5%201%201%203.5%201%203.5%202%202%202%202%203.5%22%2F%3E%20%3Cpolygon%20points%3D%2215%203.5%2014%203.5%2014%202%2012.5%202%2012.5%201%2015%201%2015%203.5%22%2F%3E%20%3Cpolygon%20points%3D%2215%2015%2012.5%2015%2012.5%2014%2014%2014%2014%2012.5%2015%2012.5%2015%2015%22%2F%3E%20%3Cpolygon%20points%3D%223.5%2015%201%2015%201%2012.5%202%2012.5%202%2014%203.5%2014%203.5%2015%22%2F%3E%3C%2Fsvg%3E\"","export default \"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20x%3D%221.5%22%20y%3D%222%22%20width%3D%2213%22%20height%3D%221%22%2F%3E%3Crect%20x%3D%221.5%22%20y%3D%2213%22%20width%3D%2213%22%20height%3D%221%22%2F%3E%3Cpath%20d%3D%22M7%2C10.5H2a.47.47%2C0%2C0%2C1-.5-.5V6A.47.47%2C0%2C0%2C1%2C2%2C5.5H7a.47.47%2C0%2C0%2C1%2C.5.5v4A.47.47%2C0%2C0%2C1%2C7%2C10.5Zm-4.5-1h4v-3h-4Z%22%2F%3E%3Cpath%20d%3D%22M14%2C10.5H9a.47.47%2C0%2C0%2C1-.5-.5V6A.47.47%2C0%2C0%2C1%2C9%2C5.5h5a.47.47%2C0%2C0%2C1%2C.5.5v4A.47.47%2C0%2C0%2C1%2C14%2C10.5Zm-4.5-1h4v-3h-4Z%22%2F%3E%3C%2Fsvg%3E\"","export default \"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20x%3D%222%22%20y%3D%221.5%22%20width%3D%221%22%20height%3D%2213%22%2F%3E%3Crect%20x%3D%2213%22%20y%3D%221.5%22%20width%3D%221%22%20height%3D%2213%22%2F%3E%3Cpath%20d%3D%22M10.5%2C7.5h-5A.47.47%2C0%2C0%2C1%2C5%2C7V3a.47.47%2C0%2C0%2C1%2C.5-.5h5A.47.47%2C0%2C0%2C1%2C11%2C3V7A.47.47%2C0%2C0%2C1%2C10.5%2C7.5ZM6%2C6.5h4v-3H6Z%22%2F%3E%3Cpath%20d%3D%22M10.5%2C13.5h-5A.47.47%2C0%2C0%2C1%2C5%2C13V9a.47.47%2C0%2C0%2C1%2C.5-.5h5A.47.47%2C0%2C0%2C1%2C11%2C9v4A.47.47%2C0%2C0%2C1%2C10.5%2C13.5ZM6%2C12.5h4v-3H6Z%22%2F%3E%3C%2Fsvg%3E\"","export default \"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22currentColor%22%3E%20%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22none%22%2F%3E%20%3Cpath%20d%3D%22M28%2C4H4A2%2C2%2C0%2C0%2C0%2C2%2C6V26a2%2C2%2C0%2C0%2C0%2C2%2C2H28a2%2C2%2C0%2C0%2C0%2C2-2V6A2%2C2%2C0%2C0%2C0%2C28%2C4Zm0%2C22H12V17.1h8.9l-2.5%2C2.5%2C1.5%2C1.5L25%2C16l-5.1-5.1-1.5%2C1.5%2C2.5%2C2.5H12V6H28Z%22%2F%3E%3C%2Fsvg%3E\"","export default \"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22currentColor%22%3E%20%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22none%22%2F%3E%20%3Cpath%20d%3D%22M28%2C4H4A2%2C2%2C0%2C0%2C0%2C2%2C6V26a2%2C2%2C0%2C0%2C0%2C2%2C2H28a2%2C2%2C0%2C0%2C0%2C2-2V6A2%2C2%2C0%2C0%2C0%2C28%2C4Zm0%2C11H19.1l2.5-2.5L20.1%2C11%2C15%2C16l5.1%2C5.1%2C1.5-1.5-2.5-2.5H28V26H12V6H28Z%22%2F%3E%3C%2Fsvg%3E\"","export default \"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22currentColor%22%3E%20%3Cpath%20d%3D%22M27%2C12V27H5V5H20V3H5A2%2C2%2C0%2C0%2C0%2C3%2C5V27a2%2C2%2C0%2C0%2C0%2C2%2C2H27a2%2C2%2C0%2C0%2C0%2C2-2V12Z%22%2F%3E%20%3Ccircle%20class%3D%22dot%22%20cx%3D%2226.5%22%20cy%3D%225.5%22%20r%3D%223.5%22%2F%3E%3C%2Fsvg%3E\"","/*\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 React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { Button } from \"carbon-components-react\";\nimport { OverflowMenuVertical16 } from \"@carbon/icons-react\";\n\nclass ToolbarOverflowItem extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.toggleExtendedMenu = this.toggleExtendedMenu.bind(this);\n\t}\n\n\ttoggleExtendedMenu() {\n\t\tthis.props.toggleExtendedMenu(this.props.index);\n\t}\n\n\trender() {\n\t\tlet overflowMenu = null;\n\t\tif (this.props.showExtendedMenu) {\n\t\t\tconst menuItems = this.props.generateExtensionMenuItems(this.props.index);\n\t\t\tif (menuItems.length > 0) {\n\t\t\t\toverflowMenu = (\n\t\t\t\t\t<div className={\"toolbar-popover-list\"}>\n\t\t\t\t\t\t{menuItems}\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst className = \"toolbar-spacer toolbar-index-\" + this.props.index;\n\n\t\treturn (\n\t\t\t<div className={className} >\n\t\t\t\t<div className={\"toolbar-overflow-item\"}>\n\t\t\t\t\t<Button kind=\"ghost\"\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\tonClick={this.toggleExtendedMenu}\n\t\t\t\t\t\tonFocus={this.props.onFocus}\n\t\t\t\t\t\taria-label={this.props.label}\n\t\t\t\t\t\tsize={this.props.size}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"toolbar-item-content default\">\n\t\t\t\t\t\t\t<div className=\"toolbar-icon\">\n\t\t\t\t\t\t\t\t<OverflowMenuVertical16 />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{overflowMenu}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nToolbarOverflowItem.propTypes = {\n\tshowExtendedMenu: PropTypes.bool.isRequired,\n\ttoggleExtendedMenu: PropTypes.func.isRequired,\n\tindex: PropTypes.number.isRequired,\n\tgenerateExtensionMenuItems: PropTypes.func,\n\tonFocus: PropTypes.func,\n\tlabel: PropTypes.string,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"])\n};\n\nexport default ToolbarOverflowItem;\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 */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nclass ToolbarDividerItem extends React.Component {\n\n\trender() {\n\t\tconst dividerClassName = this.props.overflow ? \"toolbar-divider-overflow\" : \"toolbar-divider\";\n\n\t\t// Add a space as content. When using display: inline-block the div needs\n\t\t// some content so it is displayed inline with the other elements of the\n\t\t// toolbar. With no content it is displayed above (!) the other elements.\n\t\treturn (\n\t\t\t<div className={dividerClassName} data-toolbar-item tabIndex={-1} aria-hidden >&nbsp;</div>\n\t\t);\n\t}\n}\n\nToolbarDividerItem.propTypes = {\n\toverflow: PropTypes.bool\n};\n\nexport default ToolbarDividerItem;\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 */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport ReactResizeDetector from \"react-resize-detector\";\n\nimport ToolbarActionItem from \"./toolbar-action-item.jsx\";\nimport ToolbarOverflowItem from \"./toolbar-overflow-item.jsx\";\nimport ToolbarDividerItem from \"./toolbar-divider-item.jsx\";\n\nclass Toolbar extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tshowExtendedMenuIndex: -1,\n\t\t\tsubAreaDisplayedForAction: \"\"\n\t\t};\n\n\t\tthis.leftBar = [];\n\t\tthis.rightBar = [];\n\n\t\tthis.onFocus = this.onFocus.bind(this);\n\t\tthis.onToolbarResize = this.onToolbarResize.bind(this);\n\t\tthis.toggleExtendedMenu = this.toggleExtendedMenu.bind(this);\n\t\tthis.generateExtensionMenuItems = this.generateExtensionMenuItems.bind(this);\n\t\tthis.generateToolbarItems = this.generateToolbarItems.bind(this);\n\t\tthis.subMenuActionHandler = this.subMenuActionHandler.bind(this);\n\t}\n\n\t// When the toolbar is initially opened the tabindex for each element may not\n\t// be set correctly because of the time it takes to initially render the DOM.\n\t// Typically, this means the tabindex is not set correctly on whichever\n\t// overflow menu icon is displayed. Therefore, as the user moves the focus\n\t// to the first element in the toolbar (whose tabindex IS typically OK) we\n\t// set the tabindex for all elements again, this then sets the overflow\n\t// icon's tabindex correctly.\n\tonFocus() {\n\t\tthis.setLeftBarItemsTabIndex();\n\t\tthis.setRightBarItemsTabIndex();\n\t}\n\n\t// Prevents the inline-block elements of the left bar being scrolled to\n\t// reveal the wrapped elements, when the user tabs through the elements.\n\tonScroll(evt) {\n\t\tevt.currentTarget.scroll(0, 0);\n\t\tevt.preventDefault();\n\t}\n\n\t// Close the overflow menu, if it is open, when the toolbar is resized in\n\t// case a new menu needs to be displayed with the new toolbar width.\n\tonToolbarResize() {\n\t\tif (this.state.showExtendedMenuIndex > -1) {\n\t\t\tthis.setState({ showExtendedMenuIndex: -1 });\n\t\t}\n\n\t\tthis.setLeftBarItemsTabIndex();\n\t\tthis.setRightBarItemsTabIndex();\n\t}\n\n\t// Sets the tabindex on all left bar items so tabbing works correctly. This\n\t// falls into two parts: 1. Set the tabindex for all overflow items to -1\n\t// except the overflow item that is displayed (if there is one). 2. Set the\n\t// tabindex of all hidden regular toolbar items to -1 and to 0 for all\n\t// displayed regular toolbar items.\n\t// Note: We detect the y coordinate of the 'top row' by using the top of\n\t// the first overflow icon. This is because the toolbar might be compressed\n\t// to the extent that the first overflow icon is the only item on the left\n\t// of the toolbar.\n\tsetLeftBarItemsTabIndex() {\n\t\tconst bar = this.getBar(\"left\");\n\t\tif (!bar) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst items = bar.querySelectorAll(\"[data-toolbar-item=true]\") || [];\n\t\tconst topRow = this.getTopOfFirstOverflowItem(bar);\n\t\tlet lastTopRowElement = -1;\n\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\tconst itemRect = items[i].getBoundingClientRect();\n\n\t\t\tthis.setOverflowItemButtonTabIndex(i, -1, bar);\n\n\t\t\tif (itemRect.top === topRow) {\n\t\t\t\tlastTopRowElement = i;\n\t\t\t\tthis.setToolbarItemButtonTabIndex(items[i], 0);\n\t\t\t} else {\n\t\t\t\tthis.setToolbarItemButtonTabIndex(items[i], -1);\n\t\t\t}\n\t\t}\n\n\t\tif (lastTopRowElement < items.length) {\n\t\t\tthis.setOverflowItemButtonTabIndex(lastTopRowElement + 1, 0, bar);\n\t\t}\n\t}\n\n\t// Sets the tabindex on all right bar items so tabbing works correctly. This\n\t// involves setting the tabindex of all hidden regular toolbar items to -1\n\t// and to 0 for all displayed regular toolbar items.\n\tsetRightBarItemsTabIndex() {\n\t\tconst items = this.getRightBarItems();\n\t\tlet topRow = 0;\n\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\tconst itemRect = items[i].getBoundingClientRect();\n\n\t\t\tif (i === 0) {\n\t\t\t\ttopRow = itemRect.top;\n\t\t\t}\n\n\t\t\tif (itemRect.top === topRow) {\n\t\t\t\tthis.setToolbarItemButtonTabIndex(items[i], 0);\n\t\t\t} else {\n\t\t\t\tthis.setToolbarItemButtonTabIndex(items[i], -1);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetBar(side) {\n\t\tconst id = this.props.instanceId;\n\t\tconst part = document.querySelector(`.toolbar-div[instanceid='${id}'] > .toolbar-${side}-bar`) || [];\n\t\treturn part;\n\t}\n\n\tgetRightBarItems() {\n\t\tconst bar = this.getBar(\"right\");\n\t\tif (!bar) {\n\t\t\treturn [];\n\t\t}\n\t\treturn bar.querySelectorAll(\"[data-toolbar-item=true]\") || [];\n\t}\n\n\tgetTopOfFirstOverflowItem(bar) {\n\t\tconst firstOverflowItem = this.getOverflowItem(0, bar);\n\t\tif (firstOverflowItem) {\n\t\t\tconst rect = firstOverflowItem.getBoundingClientRect();\n\t\t\treturn rect.top;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tgetOverflowItem(index, bar) {\n\t\tconst overflowClassName = \"toolbar-index-\" + index;\n\t\treturn bar.getElementsByClassName(overflowClassName)[0];\n\t}\n\n\tsetToolbarItemButtonTabIndex(item, tabIndex) {\n\t\tconst button = item.querySelector(\"button\");\n\t\tif (button) {\n\t\t\tbutton.setAttribute(\"tabindex\", tabIndex);\n\t\t}\n\t}\n\n\tsetOverflowItemButtonTabIndex(index, tabIndex, bar) {\n\t\tconst overflowItem = this.getOverflowItem(index, bar);\n\t\tif (overflowItem) {\n\t\t\tconst overflowButton = overflowItem.querySelector(\"button\");\n\t\t\tif (overflowButton) {\n\t\t\t\toverflowButton.setAttribute(\"tabindex\", tabIndex);\n\t\t\t}\n\t\t}\n\t}\n\n\tsubMenuActionHandler(action) {\n\t\tthis.setState({ subAreaDisplayedForAction: action });\n\t}\n\n\tgenerateToolbarItems(actionDefinitions, overflow, withSpacer) {\n\t\tconst newItems = [];\n\n\t\tfor (let i = 0; i < actionDefinitions.length; i++) {\n\t\t\tconst actionObj = actionDefinitions[i];\n\t\t\tif (actionObj) {\n\t\t\t\tif (withSpacer && !actionObj.divider) {\n\t\t\t\t\tnewItems.push(this.generateOverflowIcon(i));\n\t\t\t\t}\n\t\t\t\tnewItems.push(this.generateToolbarItem(actionObj, i, overflow));\n\t\t\t}\n\t\t}\n\t\treturn newItems;\n\t}\n\n\tgenerateToolbarItem(actionObj, i, overflow) {\n\t\tlet jsx = null;\n\t\tif (actionObj) {\n\t\t\tif (actionObj.divider) {\n\t\t\t\tjsx = (\n\t\t\t\t\t<ToolbarDividerItem\n\t\t\t\t\t\tkey={\"toolbar-item-key-\" + i}\n\t\t\t\t\t\toverflow={overflow}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst displaySubArea = overflow && this.state.subAreaDisplayedForAction === actionObj.action;\n\t\t\t\tjsx = (\n\t\t\t\t\t<ToolbarActionItem\n\t\t\t\t\t\tkey={\"toolbar-item-key-\" + i}\n\t\t\t\t\t\tactionObj={actionObj}\n\t\t\t\t\t\ttooltipDirection={this.props.tooltipDirection}\n\t\t\t\t\t\ttoolbarActionHandler={this.props.toolbarActionHandler}\n\t\t\t\t\t\tsubMenuActionHandler={this.subMenuActionHandler}\n\t\t\t\t\t\tgenerateToolbarItems={this.generateToolbarItems}\n\t\t\t\t\t\tdisplaySubArea={displaySubArea}\n\t\t\t\t\t\toverflow={overflow}\n\t\t\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\t\t\tonFocus={this.onFocus}\n\t\t\t\t\t\tsize={this.props.size}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn jsx;\n\t}\n\n\tgenerateOverflowIcon(index) {\n\t\tconst label = this.props.additionalText ? this.props.additionalText.overflowMenuLabel : \"\";\n\t\tconst jsx = (\n\t\t\t<ToolbarOverflowItem\n\t\t\t\tkey={\"toolbar-overflow-item-key-\" + index}\n\t\t\t\tindex={index}\n\t\t\t\tshowExtendedMenu={this.state.showExtendedMenuIndex === index}\n\t\t\t\ttoggleExtendedMenu={this.toggleExtendedMenu}\n\t\t\t\tgenerateExtensionMenuItems={this.generateExtensionMenuItems}\n\t\t\t\tonFocus={this.onFocus}\n\t\t\t\tlabel={label}\n\t\t\t\tsize={this.props.size}\n\t\t\t/>\n\t\t);\n\n\t\treturn jsx;\n\t}\n\n\t// Generates an array of action definition elements that correspond to the\n\t// hidden DOM items on the left and right of the toolbar. For any left bar\n\t// items we can use the leftIndex passed in to split the leftBar defintion\n\t// array, however for the right side we need to loop through the DOM items\n\t// and discover which is hidden and which is displayed.\n\tgenerateExtensionMenuItems(leftIndex) {\n\t\tconst rightItems = this.generateRightOverflowItems();\n\t\trightItems.reverse();\n\n\t\tconst overflowMenuBarItems = this.leftBar.slice(leftIndex).concat(rightItems);\n\t\tconst extensionItems = this.generateToolbarItems(overflowMenuBarItems, true, false);\n\t\treturn extensionItems;\n\t}\n\n\t// Generates an array of right side defintion items that correspond to\n\t// right side DOM items that are hidden.\n\tgenerateRightOverflowItems() {\n\t\tconst newDefItems = [];\n\t\tconst items = this.getRightBarItems();\n\t\tlet topRow = 0;\n\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\tconst rect = items[i].getBoundingClientRect();\n\n\t\t\tif (i === 0) {\n\t\t\t\ttopRow = rect.top;\n\t\t\t}\n\n\t\t\tif (rect.top !== topRow) {\n\t\t\t\tnewDefItems.push(this.rightBar[i]);\n\t\t\t}\n\t\t}\n\t\treturn newDefItems;\n\t}\n\n\ttoggleExtendedMenu(index) {\n\t\tconst newIndex = index === this.state.showExtendedMenuIndex ? -1 : index;\n\t\tthis.setState({ showExtendedMenuIndex: newIndex });\n\t}\n\n\trender() {\n\t\tthis.leftBar = this.props.config.leftBar || [];\n\t\tthis.rightBar = this.props.config.rightBar || [];\n\t\tthis.rightBar = [...this.rightBar].reverse() || [];\n\n\t\tconst leftItems = this.generateToolbarItems(this.leftBar, false, true);\n\t\tconst rightItems = this.generateToolbarItems(this.rightBar, false, false);\n\n\t\tconst toolbarSizeClass = this.props.size === \"sm\" ? \"toolbar-div toolbar-size-small\" : \"toolbar-div\";\n\t\tconst canvasToolbar = (\n\t\t\t<ReactResizeDetector handleWidth onResize={this.onToolbarResize}>\n\t\t\t\t<div className={toolbarSizeClass} instanceid={this.props.instanceId}>\n\t\t\t\t\t<div className=\"toolbar-left-bar\" onScroll={this.onScroll}>\n\t\t\t\t\t\t{leftItems}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"toolbar-right-bar\">\n\t\t\t\t\t\t{rightItems}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</ReactResizeDetector>\n\t\t);\n\t\treturn canvasToolbar;\n\t}\n}\n\nToolbar.propTypes = {\n\tconfig: PropTypes.object.isRequired,\n\tinstanceId: PropTypes.number,\n\ttoolbarActionHandler: PropTypes.func,\n\ttooltipDirection: PropTypes.string,\n\tadditionalText: PropTypes.object,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"])\n};\n\nexport default Toolbar;\n"],"names":["reWhitespace","trimmedEndIndex","string","index","length","test","charAt","reTrimStart","baseTrim","slice","replace","isObject","require$$1","isSymbol","require$$2","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","toNumber_1","value","other","valueOf","isBinary","_React$Component","_inherits","ToolbarActionItem","_super","_createSuper","props","_this","_classCallCheck","call","actionClickHandler","bind","_assertThisInitialized","onMouseEnter","onMouseLeave","_createClass","key","evt","this","actionObj","subMenu","subPanel","subMenuActionHandler","action","disabled","enable","TOOLBAR_STOP","React","createElement","StopFilledAlt16","TOOLBAR_RUN","Play16","TOOLBAR_EXPAND_SUPERNODE_IN_PLACE","Maximize16","TOOLBAR_COLLAPSE_SUPERNODE_IN_PLACE","Minimize16","TOOLBAR_EXPAND_SUPERNODE_FULL_PAGE","Launch16","TOOLBAR_UNDO","Undo16","TOOLBAR_REDO","Redo16","TOOLBAR_CUT","Cut16","TOOLBAR_COPY","Copy16","TOOLBAR_PASTE","Paste16","TOOLBAR_CREATE_COMMENT","TOOLBAR_CREATE_AUTO_COMMENT","AddComment16","TOOLBAR_SHOW_COMMENTS","Chat16","TOOLBAR_HIDE_COMMENTS","ChatOff16","TOOLBAR_COLOR_BACKGROUND","ColorPalette16","TOOLBAR_DELETE_LINK","TOOLBAR_DELETE_SELECTED_OBJECTS","TrashCan16","TOOLBAR_SET_COMMENT_EDIT_MODE","TOOLBAR_SET_NODE_LABEL_EDIT","Edit16","TOOLBAR_ZOOM_IN","ZoomIn16","TOOLBAR_ZOOM_OUT","ZoomOut16","TOOLBAR_ZOOM_FIT","SVG","src","TOOLBAR_ARRANGE_HORIZONALLY","TOOLBAR_ARRANGE_VERTICALLY","TOOLBAR_OPEN_PALETTE","TOOLBAR_CLOSE_PALETTE","TOOLBAR_TOGGLE_NOTIFICATION_PANEL","label","disable","overflow","incLabelWithIcon","className","generateLabelType","inLabelWithIcon","icon","getDefaultIcon","iconEnabled","iconDisabled","customIcon","id","instanceId","toolbarActionHandler","labelBefore","labelAfter","generateLabel","generateIcon","textContent","itemContentClassName","classNames","default","kind","chevronIcon","ChevronRight16","buttonContent","wrapInTooltip","ariaLabel","Button","onClick","onFocus","size","content","showLabelAsTip","tooltip","actionName","generateActionName","tip","tooltipId","enableTooltip","jsx","direction","tooltipDirection","Tooltip","displaySubArea","style","calcSubAreaStyle","subMenuItems","generateToolbarItems","elements","document","getElementsByClassName","rect","getBoundingClientRect","top","left","width","divContent","generateButton","isToolbarItem","kindAsClass","itemClassName","isSelected","subArea","generateSubArea","Component","ToolbarOverflowItem","toggleExtendedMenu","overflowMenu","showExtendedMenu","menuItems","generateExtensionMenuItems","tabIndex","OverflowMenuVertical16","ToolbarDividerItem","apply","arguments","dividerClassName","Toolbar","state","showExtendedMenuIndex","subAreaDisplayedForAction","leftBar","rightBar","onToolbarResize","setLeftBarItemsTabIndex","setRightBarItemsTabIndex","currentTarget","scroll","preventDefault","setState","bar","getBar","items","querySelectorAll","topRow","getTopOfFirstOverflowItem","lastTopRowElement","i","itemRect","setOverflowItemButtonTabIndex","setToolbarItemButtonTabIndex","getRightBarItems","side","querySelector","concat","firstOverflowItem","getOverflowItem","overflowClassName","item","button","setAttribute","overflowItem","overflowButton","actionDefinitions","withSpacer","newItems","divider","push","generateOverflowIcon","generateToolbarItem","additionalText","overflowMenuLabel","leftIndex","rightItems","generateRightOverflowItems","reverse","overflowMenuBarItems","newDefItems","newIndex","config","_toConsumableArray","leftItems","toolbarSizeClass","ReactResizeDetector","handleWidth","onResize","instanceid","onScroll"],"mappings":"mjBACIA,EAAe,SCDfC,EDWJ,SAAyBC,GAGvB,IAFA,IAAIC,EAAQD,EAAOE,OAEZD,KAAWH,EAAaK,KAAKH,EAAOI,OAAOH,MAClD,OAAOA,CACT,ECbII,EAAc,WCHdC,EDYJ,SAAkBN,GAChB,OAAOA,EACHA,EAAOO,MAAM,EAAGR,EAAgBC,GAAU,GAAGQ,QAAQH,EAAa,IAClEL,CACN,ECfIS,EAAWC,aACXC,EAAWC,aAMXC,EAAa,qBAGbC,EAAa,aAGbC,EAAY,cAGZC,EAAeC,aA8CnBC,EArBA,SAAkBC,GAChB,GAAoB,iBAATA,EACT,OAAOA,EAET,GAAIR,EAASQ,GACX,OA1CM,IA4CR,GAAIV,EAASU,GAAQ,CACnB,IAAIC,EAAgC,mBAAjBD,EAAME,QAAwBF,EAAME,UAAYF,EACnEA,EAAQV,EAASW,GAAUA,EAAQ,GAAMA,EAE3C,GAAoB,iBAATD,EACT,OAAiB,IAAVA,EAAcA,GAASA,EAEhCA,EAAQb,EAASa,GACjB,IAAIG,EAAWR,EAAWX,KAAKgB,GAC/B,OAAQG,GAAYP,EAAUZ,KAAKgB,GAC/BH,EAAaG,EAAMZ,MAAM,GAAIe,EAAW,EAAI,GAC3CT,EAAWV,KAAKgB,GAvDb,KAuD6BA,CACvC,oeClBuD,eAEhCI,GAAAC,YAAAC,EAAAF,GAAA,IAAAG,EAAAC,EAAAF,GACtB,SAAAA,EAAYG,GAAO,IAAAC,EAK+B,OAL/BC,uBAAAL,IAClBI,EAAAH,EAAAK,UAA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B/L,KAAKZ,MAAMqG,KAAgB,iCAAmC,cAavF,OAXChF,UAAAC,cAACsL,WAAoBC,eAAYC,SAAUlM,KAAK8I,iBAC/CrI,UAAAC,qBAAKmD,UAAWkI,EAAkBI,WAAYnM,KAAKZ,MAAMkF,YACxD7D,UAAAC,qBAAKmD,UAAU,mBAAmBuI,SAAUpM,KAAKoM,UAC/CN,GAEFrL,UAAAC,qBAAKmD,UAAU,qBACbyH,SAML9C,CAAA,EA7RoB/H,UAAMkH"}
@@ -1,2 +0,0 @@
1
- import{M as e,J as t}from"./isArrayLikeObject-6a001191.js";import{b as n}from"./datarecord-metadata-v3-schema-9e9ba30d.js";import{_ as r,a}from"./createClass-be661622.js";import{_ as o,a as s,b as i,c as l}from"./getPrototypeOf-3751add9.js";import c from"react";import u from"react-resize-detector";import d from"./lib/tooltip.es.js";import{Button as h}from"carbon-components-react";import p from"react-inlinesvg";import{c as C}from"./_baseForOwn-721741a9.js";import{ZoomOut16 as b,ZoomIn16 as f,Edit16 as v,TrashCan16 as m,ColorPalette16 as g,ChatOff16 as E,Chat16 as y,AddComment16 as x,Paste16 as I,Copy16 as w,Cut16 as F,Redo16 as D,Undo16 as M,Launch16 as A,Minimize16 as k,Maximize16 as B,Play16 as T,StopFilledAlt16 as O,ChevronRight16 as j,OverflowMenuVertical16 as H}from"@carbon/icons-react";import{T as R,i as N,j as L,k as S,l as V,m as z,n as Z,o as P,p as W,q,r as $,s as _,t as J,u as G,v as K,w as Q,x as U,y as X,z as Y,A as ee,B as te,D as ne,F as re,G as ae,H as oe,J as se,K as ie}from"./canvas-constants-187a30d5.js";var le=/\s/;var ce=function(e){for(var t=e.length;t--&&le.test(e.charAt(t)););return t},ue=/^\s+/;var de=function(e){return e?e.slice(0,ce(e)+1).replace(ue,""):e},he=e,pe=t,Ce=/^[-+]0x[0-9a-f]+$/i,be=/^0b[01]+$/i,fe=/^0o[0-7]+$/i,ve=parseInt;var me=function(e){if("number"==typeof e)return e;if(pe(e))return NaN;if(he(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=he(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=de(e);var n=be.test(e);return n||fe.test(e)?ve(e.slice(2),n?2:8):Ce.test(e)?NaN:+e};function ge(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return i(this,n)}}var Ee=function(e){o(n,e);var t=ge(n);function n(e){var a;return r(this,n),(a=t.call(this,e)).actionClickHandler=a.actionClickHandler.bind(l(a)),a.onMouseEnter=a.onMouseEnter.bind(l(a)),a.onMouseLeave=a.onMouseLeave.bind(l(a)),a}return a(n,[{key:"onMouseEnter",value:function(e){(this.props.actionObj.subMenu||this.props.actionObj.subPanel)&&this.props.subMenuActionHandler(this.props.actionObj.action)}},{key:"onMouseLeave",value:function(e){(this.props.actionObj.subMenu||this.props.actionObj.subPanel)&&this.props.subMenuActionHandler("")}},{key:"getDefaultIcon",value:function(e){var t=!e.enable;switch(e.action){case ie:return c.createElement(O,{disabled:t});case se:return c.createElement(T,{disabled:t});case oe:return c.createElement(B,{disabled:t});case ae:return c.createElement(k,{disabled:t});case re:return c.createElement(A,{disabled:t});case ne:return c.createElement(M,{disabled:t});case te:return c.createElement(D,{disabled:t});case ee:return c.createElement(F,{disabled:t});case Y:return c.createElement(w,{disabled:t});case X:return c.createElement(I,{disabled:t});case U:case Q:return c.createElement(x,{disabled:t});case K:return c.createElement(y,{disabled:t});case G:return c.createElement(E,{disabled:t});case J:return c.createElement(g,{disabled:t});case _:case $:return c.createElement(m,{disabled:t});case q:case W:return c.createElement(v,{disabled:t});case P:return c.createElement(f,{disabled:t});case Z:return c.createElement(b,{disabled:t});case z:return c.createElement(p,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22currentColor%22%3E%20%3Cpath%20d%3D%22M6%2C7.5h4v1H6Z%22%2F%3E%20%3Cpath%20d%3D%22M4%2C12h8a.94.94%2C0%2C0%2C0%2C1-1V5a.94.94%2C0%2C0%2C0-1-1H4A.94.94%2C0%2C0%2C0%2C3%2C5v6A.94.94%2C0%2C0%2C0%2C4%2C12ZM4%2C5h8v6H4Z%22%2F%3E%20%3Cpolygon%20points%3D%222%203.5%201%203.5%201%201%203.5%201%203.5%202%202%202%202%203.5%22%2F%3E%20%3Cpolygon%20points%3D%2215%203.5%2014%203.5%2014%202%2012.5%202%2012.5%201%2015%201%2015%203.5%22%2F%3E%20%3Cpolygon%20points%3D%2215%2015%2012.5%2015%2012.5%2014%2014%2014%2014%2012.5%2015%2012.5%2015%2015%22%2F%3E%20%3Cpolygon%20points%3D%223.5%2015%201%2015%201%2012.5%202%2012.5%202%2014%203.5%2014%203.5%2015%22%2F%3E%3C%2Fsvg%3E",disabled:t});case V:return c.createElement(p,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20x%3D%221.5%22%20y%3D%222%22%20width%3D%2213%22%20height%3D%221%22%2F%3E%3Crect%20x%3D%221.5%22%20y%3D%2213%22%20width%3D%2213%22%20height%3D%221%22%2F%3E%3Cpath%20d%3D%22M7%2C10.5H2a.47.47%2C0%2C0%2C1-.5-.5V6A.47.47%2C0%2C0%2C1%2C2%2C5.5H7a.47.47%2C0%2C0%2C1%2C.5.5v4A.47.47%2C0%2C0%2C1%2C7%2C10.5Zm-4.5-1h4v-3h-4Z%22%2F%3E%3Cpath%20d%3D%22M14%2C10.5H9a.47.47%2C0%2C0%2C1-.5-.5V6A.47.47%2C0%2C0%2C1%2C9%2C5.5h5a.47.47%2C0%2C0%2C1%2C.5.5v4A.47.47%2C0%2C0%2C1%2C14%2C10.5Zm-4.5-1h4v-3h-4Z%22%2F%3E%3C%2Fsvg%3E",disabled:t});case S:return c.createElement(p,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20x%3D%222%22%20y%3D%221.5%22%20width%3D%221%22%20height%3D%2213%22%2F%3E%3Crect%20x%3D%2213%22%20y%3D%221.5%22%20width%3D%221%22%20height%3D%2213%22%2F%3E%3Cpath%20d%3D%22M10.5%2C7.5h-5A.47.47%2C0%2C0%2C1%2C5%2C7V3a.47.47%2C0%2C0%2C1%2C.5-.5h5A.47.47%2C0%2C0%2C1%2C11%2C3V7A.47.47%2C0%2C0%2C1%2C10.5%2C7.5ZM6%2C6.5h4v-3H6Z%22%2F%3E%3Cpath%20d%3D%22M10.5%2C13.5h-5A.47.47%2C0%2C0%2C1%2C5%2C13V9a.47.47%2C0%2C0%2C1%2C.5-.5h5A.47.47%2C0%2C0%2C1%2C11%2C9v4A.47.47%2C0%2C0%2C1%2C10.5%2C13.5ZM6%2C12.5h4v-3H6Z%22%2F%3E%3C%2Fsvg%3E",disabled:t});case L:return c.createElement(p,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22currentColor%22%3E%20%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22none%22%2F%3E%20%3Cpath%20d%3D%22M28%2C4H4A2%2C2%2C0%2C0%2C0%2C2%2C6V26a2%2C2%2C0%2C0%2C0%2C2%2C2H28a2%2C2%2C0%2C0%2C0%2C2-2V6A2%2C2%2C0%2C0%2C0%2C28%2C4Zm0%2C22H12V17.1h8.9l-2.5%2C2.5%2C1.5%2C1.5L25%2C16l-5.1-5.1-1.5%2C1.5%2C2.5%2C2.5H12V6H28Z%22%2F%3E%3C%2Fsvg%3E",disabled:t});case N:return c.createElement(p,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22currentColor%22%3E%20%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22none%22%2F%3E%20%3Cpath%20d%3D%22M28%2C4H4A2%2C2%2C0%2C0%2C0%2C2%2C6V26a2%2C2%2C0%2C0%2C0%2C2%2C2H28a2%2C2%2C0%2C0%2C0%2C2-2V6A2%2C2%2C0%2C0%2C0%2C28%2C4Zm0%2C11H19.1l2.5-2.5L20.1%2C11%2C15%2C16l5.1%2C5.1%2C1.5-1.5-2.5-2.5H28V26H12V6H28Z%22%2F%3E%3C%2Fsvg%3E",disabled:t});case R:return c.createElement(p,{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22currentColor%22%3E%20%3Cpath%20d%3D%22M27%2C12V27H5V5H20V3H5A2%2C2%2C0%2C0%2C0%2C3%2C5V27a2%2C2%2C0%2C0%2C0%2C2%2C2H27a2%2C2%2C0%2C0%2C0%2C2-2V12Z%22%2F%3E%20%3Ccircle%20class%3D%22dot%22%20cx%3D%2226.5%22%20cy%3D%225.5%22%20r%3D%223.5%22%2F%3E%3C%2Fsvg%3E",disabled:t});default:return null}}},{key:"generateLabel",value:function(e,t,n,r){var a="toolbar-icon-label";return a+=this.generateLabelType(n,r),a+=t?" disabled":"",c.createElement("div",{className:a},e)}},{key:"generateLabelType",value:function(e,t){return e?" overflow":"before"===t?" before":"after"===t?" after":""}},{key:"generateIcon",value:function(e){var t=this.getDefaultIcon(e);if(e.iconEnabled){var n=e.iconEnabled,r=e.iconDisabled||e.iconEnabled,a=e.enable?n:r,o="toolbar-icon-"+this.props.instanceId+" -"+e.action;t="string"==typeof a?c.createElement(p,{id:o,src:a,disabled:!e.enable}):a}return t?c.createElement("div",{className:"toolbar-icon"},t):null}},{key:"actionClickHandler",value:function(e){this.props.actionObj.subMenu||this.props.actionObj.subPanel||this.props.toolbarActionHandler(this.props.actionObj.action,e)}},{key:"generateButton",value:function(e){var t=null,n=null;this.props.overflow?n=this.generateLabel(e.label,!e.enable,!0):"before"===e.incLabelWithIcon?t=this.generateLabel(e.label,!e.enable,!1,e.incLabelWithIcon):"after"===e.incLabelWithIcon&&(n=this.generateLabel(e.label,!e.enable,!1,e.incLabelWithIcon));var r=this.generateIcon(e),a=e.textContent?c.createElement("div",{className:"toolbar-text-content"}," ",e.textContent," "):null,o=C("toolbar-item-content",e.className?e.className:null,{overflow:this.props.overflow,disabled:!e.enable,default:!e.kind}),s=e.kind||"ghost",i=e.subMenu||this.props.actionObj.subPanel?c.createElement(j,null):null,l=c.createElement("div",{className:o},t,r,n,a,i);l=this.wrapInTooltip(l);var u=e.incLabelWithIcon?null:e.label;return l=c.createElement(h,{kind:s,onClick:this.actionClickHandler,disabled:!e.enable,onFocus:this.props.onFocus,"aria-label":u,size:this.props.size},l)}},{key:"generateActionName",value:function(e){return this.props.actionObj.action+"-action"}},{key:"wrapInTooltip",value:function(e){if(!this.props.overflow&&(this.showLabelAsTip(this.props.actionObj)||this.props.actionObj.tooltip)){var t=this.generateActionName(),n=this.props.actionObj.tooltip?this.props.actionObj.tooltip:this.props.actionObj.label,r=t+"-"+this.props.instanceId+"-tooltip",a=this.props.actionObj.enable||this.props.actionObj.jsx,o=this.props.tooltipDirection?this.props.tooltipDirection:"bottom";return c.createElement(d,{id:r,tip:n,disable:!a,className:"icon-tooltip",direction:o},e)}return e}},{key:"showLabelAsTip",value:function(e){return!!e.label&&("before"!==e.incLabelWithIcon&&"after"!==e.incLabelWithIcon)}},{key:"generateSubArea",value:function(){if(this.props.displaySubArea){var e=this.calcSubAreaStyle();if(this.props.actionObj.subPanel)return c.createElement("div",{style:e,className:"toolbar-popover-list subpanel"},this.props.actionObj.subPanel);var t=this.props.generateToolbarItems(this.props.actionObj.subMenu,!0,!1);return c.createElement("div",{style:e,className:"toolbar-popover-list submenu"},t)}return null}},{key:"calcSubAreaStyle",value:function(){var e=this.generateActionName(),t=document.getElementsByClassName(e),n=t&&t.length>0?t[0].getBoundingClientRect():{top:0,left:0,width:120};return{top:n.top-1,left:n.left+n.width}}},{key:"render",value:function(){var e=this.props.actionObj,t=this.generateActionName(),n=null;n=e.jsx?this.wrapInTooltip(e.jsx):this.generateButton(e);var r=!this.props.overflow||null,a=e.kind?e.kind:"default",o=C({"toolbar-overflow-menu-item":this.props.overflow,"toolbar-item":!this.props.overflow&&!e.jsx,"toolbar-jsx-item":!this.props.overflow&&e.jsx,"toolbar-overflow-jsx-item":this.props.overflow&&e.jsx,"toolbar-item-selected":e.isSelected},a,t),s=this.generateSubArea();return c.createElement("div",{className:o,"data-toolbar-item":r,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},n,s)}}]),n}(c.Component);function ye(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return i(this,n)}}var xe=function(e){o(n,e);var t=ye(n);function n(e){var a;return r(this,n),(a=t.call(this,e)).toggleExtendedMenu=a.toggleExtendedMenu.bind(l(a)),a}return a(n,[{key:"toggleExtendedMenu",value:function(){this.props.toggleExtendedMenu(this.props.index)}},{key:"render",value:function(){var e=null;if(this.props.showExtendedMenu){var t=this.props.generateExtensionMenuItems(this.props.index);t.length>0&&(e=c.createElement("div",{className:"toolbar-popover-list"},t))}var n="toolbar-spacer toolbar-index-"+this.props.index;return c.createElement("div",{className:n},c.createElement("div",{className:"toolbar-overflow-item"},c.createElement(h,{kind:"ghost",tabIndex:-1,onClick:this.toggleExtendedMenu,onFocus:this.props.onFocus,"aria-label":this.props.label,size:this.props.size},c.createElement("div",{className:"toolbar-item-content default"},c.createElement("div",{className:"toolbar-icon"},c.createElement(H,null))))),e)}}]),n}(c.Component);function Ie(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return i(this,n)}}var we=function(e){o(n,e);var t=Ie(n);function n(){return r(this,n),t.apply(this,arguments)}return a(n,[{key:"render",value:function(){var e=this.props.overflow?"toolbar-divider-overflow":"toolbar-divider";return c.createElement("div",{className:e,"data-toolbar-item":!0,tabIndex:-1,"aria-hidden":!0}," ")}}]),n}(c.Component);function Fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return i(this,n)}}var De=function(e){o(s,e);var t=Fe(s);function s(e){var n;return r(this,s),(n=t.call(this,e)).state={showExtendedMenuIndex:-1,subAreaDisplayedForAction:""},n.leftBar=[],n.rightBar=[],n.onFocus=n.onFocus.bind(l(n)),n.onToolbarResize=n.onToolbarResize.bind(l(n)),n.toggleExtendedMenu=n.toggleExtendedMenu.bind(l(n)),n.generateExtensionMenuItems=n.generateExtensionMenuItems.bind(l(n)),n.generateToolbarItems=n.generateToolbarItems.bind(l(n)),n.subMenuActionHandler=n.subMenuActionHandler.bind(l(n)),n}return a(s,[{key:"onFocus",value:function(){this.setLeftBarItemsTabIndex(),this.setRightBarItemsTabIndex()}},{key:"onScroll",value:function(e){e.currentTarget.scroll(0,0),e.preventDefault()}},{key:"onToolbarResize",value:function(){this.state.showExtendedMenuIndex>-1&&this.setState({showExtendedMenuIndex:-1}),this.setLeftBarItemsTabIndex(),this.setRightBarItemsTabIndex()}},{key:"setLeftBarItemsTabIndex",value:function(){var e=this.getBar("left");if(e){for(var t=e.querySelectorAll("[data-toolbar-item=true]")||[],n=this.getTopOfFirstOverflowItem(e),r=-1,a=0;a<t.length;a++){var o=t[a].getBoundingClientRect();this.setOverflowItemButtonTabIndex(a,-1,e),o.top===n?(r=a,this.setToolbarItemButtonTabIndex(t[a],0)):this.setToolbarItemButtonTabIndex(t[a],-1)}r<t.length&&this.setOverflowItemButtonTabIndex(r+1,0,e)}}},{key:"setRightBarItemsTabIndex",value:function(){for(var e=this.getRightBarItems(),t=0,n=0;n<e.length;n++){var r=e[n].getBoundingClientRect();0===n&&(t=r.top),r.top===t?this.setToolbarItemButtonTabIndex(e[n],0):this.setToolbarItemButtonTabIndex(e[n],-1)}}},{key:"getBar",value:function(e){var t=this.props.instanceId;return document.querySelector(".toolbar-div[instanceid='".concat(t,"'] > .toolbar-").concat(e,"-bar"))||[]}},{key:"getRightBarItems",value:function(){var e=this.getBar("right");return e&&e.querySelectorAll("[data-toolbar-item=true]")||[]}},{key:"getTopOfFirstOverflowItem",value:function(e){var t=this.getOverflowItem(0,e);return t?t.getBoundingClientRect().top:0}},{key:"getOverflowItem",value:function(e,t){var n="toolbar-index-"+e;return t.getElementsByClassName(n)[0]}},{key:"setToolbarItemButtonTabIndex",value:function(e,t){var n=e.querySelector("button");n&&n.setAttribute("tabindex",t)}},{key:"setOverflowItemButtonTabIndex",value:function(e,t,n){var r=this.getOverflowItem(e,n);if(r){var a=r.querySelector("button");a&&a.setAttribute("tabindex",t)}}},{key:"subMenuActionHandler",value:function(e){this.setState({subAreaDisplayedForAction:e})}},{key:"generateToolbarItems",value:function(e,t,n){for(var r=[],a=0;a<e.length;a++){var o=e[a];o&&(n&&!o.divider&&r.push(this.generateOverflowIcon(a)),r.push(this.generateToolbarItem(o,a,t)))}return r}},{key:"generateToolbarItem",value:function(e,t,n){var r=null;if(e)if(e.divider)r=c.createElement(we,{key:"toolbar-item-key-"+t,overflow:n});else{var a=n&&this.state.subAreaDisplayedForAction===e.action;r=c.createElement(Ee,{key:"toolbar-item-key-"+t,actionObj:e,tooltipDirection:this.props.tooltipDirection,toolbarActionHandler:this.props.toolbarActionHandler,subMenuActionHandler:this.subMenuActionHandler,generateToolbarItems:this.generateToolbarItems,displaySubArea:a,overflow:n,instanceId:this.props.instanceId,onFocus:this.onFocus,size:this.props.size})}return r}},{key:"generateOverflowIcon",value:function(e){var t=this.props.additionalText?this.props.additionalText.overflowMenuLabel:"";return c.createElement(xe,{key:"toolbar-overflow-item-key-"+e,index:e,showExtendedMenu:this.state.showExtendedMenuIndex===e,toggleExtendedMenu:this.toggleExtendedMenu,generateExtensionMenuItems:this.generateExtensionMenuItems,onFocus:this.onFocus,label:t,size:this.props.size})}},{key:"generateExtensionMenuItems",value:function(e){var t=this.generateRightOverflowItems();t.reverse();var n=this.leftBar.slice(e).concat(t);return this.generateToolbarItems(n,!0,!1)}},{key:"generateRightOverflowItems",value:function(){for(var e=[],t=this.getRightBarItems(),n=0,r=0;r<t.length;r++){var a=t[r].getBoundingClientRect();0===r&&(n=a.top),a.top!==n&&e.push(this.rightBar[r])}return e}},{key:"toggleExtendedMenu",value:function(e){var t=e===this.state.showExtendedMenuIndex?-1:e;this.setState({showExtendedMenuIndex:t})}},{key:"render",value:function(){this.leftBar=this.props.config.leftBar||[],this.rightBar=this.props.config.rightBar||[],this.rightBar=n(this.rightBar).reverse()||[];var e=this.generateToolbarItems(this.leftBar,!1,!0),t=this.generateToolbarItems(this.rightBar,!1,!1),r="sm"===this.props.size?"toolbar-div toolbar-size-small":"toolbar-div";return c.createElement(u,{handleWidth:!0,onResize:this.onToolbarResize},c.createElement("div",{className:r,instanceid:this.props.instanceId},c.createElement("div",{className:"toolbar-left-bar",onScroll:this.onScroll},e),c.createElement("div",{className:"toolbar-right-bar"},t)))}}]),s}(c.Component);export{De as T,me as t};
2
- //# sourceMappingURL=toolbar-7140292d.js.map