@elyra/canvas 12.44.0 → 12.45.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.
- package/dist/{canvas-constants-69e90162.js → canvas-constants-3bbfc8b1.js} +2 -2
- package/dist/{canvas-constants-69e90162.js.map → canvas-constants-3bbfc8b1.js.map} +1 -1
- package/dist/{canvas-constants-089e7830.js → canvas-constants-8d240dc6.js} +2 -2
- package/dist/{canvas-constants-089e7830.js.map → canvas-constants-8d240dc6.js.map} +1 -1
- package/dist/{canvas-controller-3e6b8ce4.js → canvas-controller-a926ab2b.js} +2 -2
- package/dist/{canvas-controller-c6274fad.js.map → canvas-controller-a926ab2b.js.map} +1 -1
- package/dist/{canvas-controller-c6274fad.js → canvas-controller-e2503333.js} +2 -2
- package/dist/{canvas-controller-3e6b8ce4.js.map → canvas-controller-e2503333.js.map} +1 -1
- package/dist/common-canvas-41b0454f.js +2 -0
- package/dist/common-canvas-41b0454f.js.map +1 -0
- package/dist/common-canvas-460a4434.js +2 -0
- package/dist/common-canvas-460a4434.js.map +1 -0
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/{common-properties-b295acc8.js → common-properties-b25b4855.js} +2 -2
- package/dist/{common-properties-b295acc8.js.map → common-properties-b25b4855.js.map} +1 -1
- package/dist/{common-properties-88377242.js → common-properties-e262caa2.js} +2 -2
- package/dist/{common-properties-88377242.js.map → common-properties-e262caa2.js.map} +1 -1
- package/dist/{datarecord-metadata-v3-schema-07d18e19.js → datarecord-metadata-v3-schema-2311ecab.js} +2 -2
- package/dist/{datarecord-metadata-v3-schema-07d18e19.js.map → datarecord-metadata-v3-schema-2311ecab.js.map} +1 -1
- package/dist/{datarecord-metadata-v3-schema-df939dd1.js → datarecord-metadata-v3-schema-d279dbb0.js} +2 -2
- package/dist/{datarecord-metadata-v3-schema-df939dd1.js.map → datarecord-metadata-v3-schema-d279dbb0.js.map} +1 -1
- package/dist/{icon-56b27c4f.js → icon-65758bb8.js} +2 -2
- package/dist/{icon-56b27c4f.js.map → icon-65758bb8.js.map} +1 -1
- package/dist/{icon-8ec2f0ec.js → icon-b3738f1f.js} +2 -2
- package/dist/{icon-8ec2f0ec.js.map → icon-b3738f1f.js.map} +1 -1
- package/dist/{index-79543d41.js → index-9eeda306.js} +2 -2
- package/dist/{index-79543d41.js.map → index-9eeda306.js.map} +1 -1
- package/dist/{index-01cbacf9.js → index-d3371fd0.js} +2 -2
- package/dist/{index-01cbacf9.js.map → index-d3371fd0.js.map} +1 -1
- package/dist/lib/canvas-controller.es.js +1 -1
- package/dist/lib/canvas-controller.js +1 -1
- package/dist/lib/canvas.es.js +1 -1
- package/dist/lib/canvas.js +1 -1
- package/dist/lib/command-stack.es.js +1 -1
- package/dist/lib/command-stack.es.js.map +1 -1
- package/dist/lib/command-stack.js +1 -1
- package/dist/lib/command-stack.js.map +1 -1
- package/dist/lib/properties/field-picker.es.js +1 -1
- package/dist/lib/properties/field-picker.js +1 -1
- package/dist/lib/properties.es.js +1 -1
- package/dist/lib/properties.js +1 -1
- package/dist/styles/common-canvas.min.css +1 -1
- package/dist/styles/common-canvas.min.css.map +1 -1
- package/dist/{toolbar-6607e35c.js → toolbar-6af353fa.js} +2 -2
- package/dist/{toolbar-6607e35c.js.map → toolbar-6af353fa.js.map} +1 -1
- package/dist/{toolbar-235dfb9d.js → toolbar-c4e22755.js} +2 -2
- package/dist/{toolbar-235dfb9d.js.map → toolbar-c4e22755.js.map} +1 -1
- package/locales/command-actions/locales/en.json +1 -0
- package/locales/command-actions/locales/eo.json +1 -0
- package/package.json +2 -2
- package/src/command-actions/sizeAndPositionObjectsAction.js +4 -0
- package/src/command-stack/command-stack.js +4 -0
- package/src/common-canvas/canvas-controller.js +29 -9
- package/src/common-canvas/cc-context-toolbar.jsx +46 -2
- package/src/common-canvas/cc-toolbar.jsx +3 -0
- package/src/common-canvas/svg-canvas-d3.js +2 -2
- package/src/common-canvas/svg-canvas-pipeline.js +1 -1
- package/src/common-canvas/svg-canvas-renderer.js +2 -2
- package/src/common-canvas/svg-canvas-utils-drag-objects.js +3 -0
- package/src/common-canvas/svg-canvas-utils-zoom.js +5 -4
- package/src/object-model/object-model.js +1 -1
- package/src/toolbar/toolbar.jsx +1 -1
- package/src/toolbar/toolbar.scss +28 -31
- package/stats.html +1 -1
- package/dist/common-canvas-6ed21ab6.js +0 -2
- package/dist/common-canvas-6ed21ab6.js.map +0 -1
- package/dist/common-canvas-8abf016c.js +0 -2
- package/dist/common-canvas-8abf016c.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar-6607e35c.js","sources":["../node_modules/lodash/_trimmedEndIndex.js","../node_modules/lodash/_baseTrim.js","../node_modules/lodash/toNumber.js","../node_modules/lodash/toFinite.js","../node_modules/lodash/toInteger.js","../src/toolbar/toolbar-button-item.jsx","../assets/images/arrange_horizontally.svg","../assets/images/arrange_vertically.svg","../assets/images/notification_counter_icon.svg","../src/toolbar/toolbar-sub-utils.js","../src/toolbar/toolbar-sub-panel.jsx","../src/toolbar/toolbar-sub-menu-item.jsx","../src/toolbar/toolbar-divider-item.jsx","../src/toolbar/toolbar-sub-menu.jsx","../src/toolbar/toolbar-action-item.jsx","../src/toolbar/toolbar-overflow-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","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var toFinite = require('./toFinite');\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\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\";\n\nimport { Button } from \"carbon-components-react\";\nimport SVG from \"react-inlinesvg\";\nimport classNames from \"classnames\";\nimport { StopFilledAlt16, Play16, Undo16, Redo16, Chat16, ChatOff16, Result16,\n\tCut16, Copy16, Paste16, Edit16,\tColorPalette16, Maximize16, Minimize16,\n\tLaunch16, AddComment16, TrashCan16, ZoomIn16, ZoomOut16,\n\tChevronRight16, ChevronDown16, ChevronUp16,\n\tCenterToFit16, OpenPanelFilledLeft16 } from \"@carbon/icons-react\";\nimport { TOOLBAR_STOP, TOOLBAR_RUN, TOOLBAR_UNDO, TOOLBAR_REDO,\n\tTOOLBAR_CUT, TOOLBAR_COPY, TOOLBAR_PASTE, TOOLBAR_CLIPBOARD,\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_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 ToolbarButtonItem extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.buttonRef = React.createRef();\n\t}\n\n\tcomponentDidUpdate() {\n\t\tif (this.props.isFocusInToolbar &&\n\t\t\t\tthis.props.buttonFocusAction === this.props.actionObj.action) {\n\t\t\t// If a Jsx object was provided, the class of the component should have\n\t\t\t// been set to toolbar-jsx-obj.\n\t\t\tconst jsxItem = this.buttonRef.current.querySelector(\".toolbar-jsx-obj\");\n\t\t\tif (jsxItem) {\n\t\t\t\tjsxItem.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.buttonRef.current.focus();\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_CLIPBOARD):\n\t\t\treturn <Result16 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\t\tcase (TOOLBAR_ZOOM_FIT):\n\t\t\treturn <CenterToFit16 disabled={disabled} />;\n\t\tcase (TOOLBAR_OPEN_PALETTE):\n\t\t\treturn <OpenPanelFilledLeft16 disabled={disabled} />;\n\t\tcase (TOOLBAR_CLOSE_PALETTE):\n\t\t\treturn <OpenPanelFilledLeft16 disabled={disabled} />;\n\t\tcase (TOOLBAR_TOGGLE_PALETTE):\n\t\t\treturn <OpenPanelFilledLeft16 disabled={disabled} />;\n\n\t\t// Non-carbon icons\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_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, isInMenu, incLabelWithIcon) {\n\t\tlet className = \"toolbar-icon-label\";\n\t\tclassName += this.generateLabelType(isInMenu, incLabelWithIcon);\n\t\tclassName += disable ? \" disabled\" : \"\";\n\t\treturn (<div className={className}>{label}</div>);\n\t}\n\n\tgenerateLabelType(isInMenu, inLabelWithIcon) {\n\t\tif (isInMenu) {\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\tgenerateRegularItem(actionObj) {\n\t\tlet labelBefore = null;\n\t\tlet labelAfter = null;\n\n\t\tif (this.props.isInMenu) {\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\t{ \"overflow\": this.props.isInMenu, \"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 = this.generateChevronIcon(actionObj);\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\t\tconst tabIndex = this.props.buttonFocusAction === actionObj.action ? 0 : -1;\n\n\t\tconst button = (\n\t\t\t<Button kind={kind}\n\t\t\t\tref={this.buttonRef}\n\t\t\t\tonClick={this.props.actionClickHandler}\n\t\t\t\tdisabled={!actionObj.enable}\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\tsize={this.props.size}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t>\n\t\t\t\t{buttonContent}\n\t\t\t</Button>\n\t\t);\n\n\t\treturn button;\n\t}\n\n\t// Returns a chevron icon if the action icon is displaying a sub-menu or\n\t// sub-panel. The chevron will:\n\t// * point right if this action item is in a drop down menu\n\t// * point down if this action item is displayed with text in the toolbar\n\t// and the menu isn't displayed\n\t// * point up if this action item is displayed with text in the toolbar\n\t// and the menu is displayed\n\t// * be a mini-chevron (small triangle in the bottom right of icon) if this\n\t// action item isn't displayed with text.\n\tgenerateChevronIcon(actionObj) {\n\t\tif (actionObj.subMenu || actionObj.subPanel) {\n\t\t\tif (this.props.isInMenu) {\n\t\t\t\treturn (<ChevronRight16 />);\n\t\t\t}\n\t\t\tif (actionObj.incLabelWithIcon === \"before\" ||\n\t\t\t\t\tactionObj.incLabelWithIcon === \"after\") {\n\t\t\t\tconst chev = this.props.subAreaDisplayed ? (<ChevronUp16 />) : (<ChevronDown16 />);\n\t\t\t\treturn (<div className={\"toolbar-up-down-chevron\"}>{chev}</div>);\n\t\t\t}\n\t\t\treturn this.generateChevronMini();\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns an svg to display the little triangle that appears in the bottom\n\t// right corner of icons that, when clicked, show a drop down menu.\n\tgenerateChevronMini() {\n\t\tconst path = this.props.size === \"sm\" ? \"M 29 29 L 29 23 23 29 Z\" : \"M 37 37 L 37 30 30 37 Z\";\n\t\treturn (\n\t\t\t<svg className=\"toolbar-tick-svg\">\n\t\t\t\t<path d={path} className=\"toolbar-tick-mark\" />\n\t\t\t</svg>\n\t\t);\n\t}\n\n\t// Creates a <div> containing the JSX in the actionObj.jsx field, wrapped in a tooltip\n\t// <div>, for display as an action item in the toolbar. The jsx field can be just\n\t// regular JSX OR a function that returns JSX. If the application has provided a\n\t// function we call it, passing in the tabIndex that the component in the JSX should\n\t// use, based on whether it is focused or not.\n\tgenerateJsxItem(actionObj) {\n\t\tlet content = null;\n\t\tif (typeof actionObj.jsx === \"function\") {\n\t\t\tconst tabIndex = this.props.buttonFocusAction === actionObj.action ? 0 : -1;\n\t\t\tcontent = actionObj.jsx(tabIndex);\n\t\t} else {\n\t\t\tcontent = actionObj.jsx;\n\t\t}\n\t\tconst jsx = this.wrapInTooltip(content);\n\t\tconst div = (<div ref={this.buttonRef}>{jsx}</div>);\n\n\t\treturn div;\n\t}\n\n\n\twrapInTooltip(content) {\n\t\tif (!this.props.isInMenu && (this.showLabelAsTip(this.props.actionObj) || this.props.actionObj.tooltip)) {\n\t\t\tconst tip = this.props.actionObj.tooltip ? this.props.actionObj.tooltip : this.props.actionObj.label;\n\t\t\tconst tooltipId = this.props.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\trender() {\n\t\tconst actionObj = this.props.actionObj;\n\n\t\tconst divContent = actionObj.jsx\n\t\t\t? this.generateJsxItem(actionObj)\n\t\t\t: this.generateRegularItem(actionObj);\n\n\t\treturn divContent;\n\t}\n}\n\nToolbarButtonItem.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\tcloseSubAreaOnClick: PropTypes.bool,\n\t\tsubMenu: PropTypes.array,\n\t\tsubPanel: PropTypes.any,\n\t\tsubPanelData: PropTypes.object,\n\t\tjsx: PropTypes.oneOfType([\n\t\t\tPropTypes.object,\n\t\t\tPropTypes.func\n\t\t]),\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\tactionName: PropTypes.string.isRequired,\n\ttooltipDirection: PropTypes.oneOf([\"top\", \"bottom\"]),\n\tinstanceId: PropTypes.number.isRequired,\n\tisInMenu: PropTypes.bool,\n\tsubAreaDisplayed: PropTypes.bool,\n\tactionClickHandler: PropTypes.func,\n\tbuttonFocusAction: PropTypes.string,\n\tisFocusInToolbar: PropTypes.bool,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"])\n};\n\nexport default ToolbarButtonItem;\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%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%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 2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\n// These utility functions are used by both toolbar-sub-menu.jsx AND\n// toolbar-sub-panel.jsx to position the sub-area (sub-menu or sub-panel)\n// relative to the parent actionItemRect, passed in, in the direction\n// indicated by the expandDirection parameter and constrained within\n// the <div> specified by the containingDivId parameter.\n\n\n// Adjust the position of the sub-area to make sure it doesn't extend\n// outside the containing divs boundary. We need to do this after the subarea\n// has been mounted so we can query its size and position.\nexport function adjustSubAreaPosition(areaRef, containingDivId, expandDirection, actionItemRect) {\n\tif (!areaRef || !actionItemRect || !containingDivId) {\n\t\treturn;\n\t}\n\tconst containingDiv = document.getElementById(containingDivId);\n\tconst containingDivRect = containingDiv\n\t\t? containingDiv.getBoundingClientRect()\n\t\t: { top: -1000, bottom: 1000, left: -1000, right: 1000 }; // To enable Jest tests.\n\n\tconst thisAreaRect = areaRef.getBoundingClientRect();\n\n\tconst outsideBottom = thisAreaRect.bottom - containingDivRect.bottom;\n\tconst outsideRight = thisAreaRect.right - containingDivRect.right;\n\n\tif (expandDirection === \"vertical\") {\n\t\tif (outsideBottom > 0) {\n\t\t\tconst topGap = actionItemRect.top - containingDivRect.top;\n\t\t\tconst newTop = (topGap > thisAreaRect.height)\n\t\t\t\t? actionItemRect.top - thisAreaRect.height\n\t\t\t\t: actionItemRect.bottom - outsideBottom;\n\n\t\t\tareaRef.style.top = newTop + \"px\";\n\t\t}\n\n\t\tif (outsideRight > 0) {\n\t\t\tconst newLeft = actionItemRect.left - outsideRight;\n\t\t\tareaRef.style.left = newLeft + \"px\";\n\t\t}\n\n\t} else {\n\t\tif (outsideBottom > 0) {\n\t\t\tconst newTop = thisAreaRect.top - outsideBottom - 2;\n\t\t\tareaRef.style.top = newTop + \"px\";\n\t\t}\n\n\t\tif (outsideRight > 0) {\n\t\t\tconst newLeft = actionItemRect.left - thisAreaRect.width;\n\t\t\tareaRef.style.left = newLeft + \"px\";\n\t\t}\n\t}\n}\n\nexport function generateSubAreaStyle(expandDirection, actionItemRect) {\n\tif (!actionItemRect) {\n\t\treturn null;\n\t}\n\n\tif (expandDirection === \"vertical\") {\n\t\treturn {\n\t\t\ttop: actionItemRect.bottom + 1,\n\t\t\tleft: actionItemRect.left\n\t\t};\n\t}\n\treturn {\n\t\ttop: actionItemRect.top - 1,\n\t\tleft: actionItemRect.left + actionItemRect.width\n\t};\n}\n\n\n","/*\n * Copyright 2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { adjustSubAreaPosition, generateSubAreaStyle } from \"./toolbar-sub-utils.js\";\n\nconst ESC_KEY = 27;\nconst LEFT_ARROW_KEY = 37;\nconst RIGHT_ARROW_KEY = 39;\n\n\nclass ToolbarSubPanel extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.closeSubPanel = this.closeSubPanel.bind(this);\n\t}\n\n\tcomponentDidMount() {\n\t\tadjustSubAreaPosition(this.areaRef,\n\t\t\tthis.props.containingDivId, this.props.expandDirection, this.props.actionItemRect);\n\t}\n\n\tcomponentDidUpdate() {\n\t\tadjustSubAreaPosition(this.areaRef,\n\t\t\tthis.props.containingDivId, this.props.expandDirection, this.props.actionItemRect);\n\t}\n\n\tonKeyDown(evt) {\n\t\tif (evt.keyCode === ESC_KEY) {\n\t\t\tthis.props.closeSubArea();\n\t\t\tevt.stopPropagation();\n\n\t\t} else if (evt.keyCode === LEFT_ARROW_KEY || evt.keyCode === RIGHT_ARROW_KEY) {\n\t\t\tevt.stopPropagation();\n\t\t}\n\t}\n\n\t// If the user clicks the panel background, by default focus would go\n\t// through to the toolbar and focus would be lost from this sub-panel.\n\t// This method prevents any focus event going through to the toolbar.\n\tonFocus(evt) {\n\t\tevt.stopPropagation();\n\t\tevt.preventDefault();\n\t}\n\n\tcloseSubPanel(evt) {\n\t\tthis.props.closeSubArea(); // Don't pass a paremeter otherwise it will check closeSubAreaOnClick.\n\t}\n\n\trender() {\n\t\tconst style = generateSubAreaStyle(this.props.expandDirection, this.props.actionItemRect);\n\n\t\tif (this.props.subPanel) {\n\t\t\treturn (\n\t\t\t\t<div ref={(ref) => (this.areaRef = ref)} style={style} className={\"toolbar-popover-list subpanel\"} tabIndex={-1}\n\t\t\t\t\tonKeyDown={this.onKeyDown} onFocus={this.onFocus}\n\t\t\t\t>\n\t\t\t\t\t<this.props.subPanel closeSubPanel={this.closeSubPanel} subPanelData={this.props.subPanelData} />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\nToolbarSubPanel.propTypes = {\n\tsubPanel: PropTypes.any.isRequired,\n\tsubPanelData: PropTypes.object,\n\tcloseSubArea: PropTypes.func,\n\tsetToolbarFocusAction: PropTypes.func,\n\tactionItemRect: PropTypes.object,\n\texpandDirection: PropTypes.string.isRequired,\n\tcontainingDivId: PropTypes.string\n};\n\nexport default ToolbarSubPanel;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport ToolbarButtonItem from \"./toolbar-button-item.jsx\";\n\nimport classNames from \"classnames\";\nimport ToolbarSubMenu from \"./toolbar-sub-menu.jsx\";\nimport ToolbarSubPanel from \"./toolbar-sub-panel.jsx\";\n\nclass ToolbarSubMenuItem extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tsubAreaDisplayed: false\n\t\t};\n\n\t\tthis.divRef = React.createRef();\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\tthis.openSubArea = this.openSubArea.bind(this);\n\t\tthis.closeSubArea = this.closeSubArea.bind(this);\n\t\tthis.clickOutside = this.clickOutside.bind(this);\n\t}\n\n\t// We must remove the eventListener in case this class is unmounted due\n\t// to the toolbar getting redrawn.\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t}\n\n\tonMouseEnter(evt) {\n\t\tif (this.props.actionObj.subMenu || this.props.actionObj.subPanel) {\n\t\t\tthis.openSubArea();\n\t\t}\n\t}\n\n\tonMouseLeave(evt) {\n\t\tif (this.props.actionObj.subMenu || this.props.actionObj.subPanel) {\n\t\t\tthis.closeSubArea();\n\t\t}\n\t}\n\n\tclickOutside(evt) {\n\t\tif (this.state.subAreaDisplayed) {\n\t\t\tconst items = document.getElementsByClassName(this.generateActionName());\n\t\t\tconst isOver = items?.length > 0 ? items[0].contains(evt.target) : false;\n\n\t\t\tif (!isOver && !this.props.actionObj.leaveSubAreaOpenOnClickOutside) {\n\t\t\t\tthis.closeSubArea();\n\t\t\t}\n\t\t}\n\t}\n\n\topenSubArea() {\n\t\tthis.setState({ subAreaDisplayed: true });\n\t}\n\n\tcloseSubArea(checkCloseSubAreaOnClick) {\n\t\tif (!checkCloseSubAreaOnClick || this.props.actionObj.closeSubAreaOnClick) {\n\t\t\tthis.setState({ subAreaDisplayed: false });\n\t\t}\n\t}\n\n\tactionClickHandler(evt) {\n\t\tif (this.props.actionObj.subMenu || this.props.actionObj.subPanel) {\n\t\t\tif (this.state.subAreaDisplayed) {\n\t\t\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t\t\t\tthis.closeSubArea();\n\t\t\t} else {\n\t\t\t\tdocument.addEventListener(\"click\", this.clickOutside, false);\n\t\t\t\tthis.openSubArea();\n\t\t\t}\n\n\t\t} else {\n\t\t\tevt.stopPropagation();\n\t\t\tif (this.props.isInCascadeMenu) {\n\t\t\t\tthis.props.closeParentSubArea(true); // true = close only if closeSubAreaOnClick is checked\n\t\t\t\tthis.props.setSubMenuFocus();\n\n\t\t\t} else if (this.props.isInOverflowMenu) {\n\t\t\t\tthis.props.setSubMenuFocus(this.props.actionObj.action);\n\n\t\t\t} else {\n\t\t\t\tthis.props.closeParentSubArea(true); // true = close only if closeSubAreaOnClick is checked\n\t\t\t\tthis.props.setToolbarFocusAction(); // Resets the toolbar focus action\n\t\t\t}\n\t\t\tthis.props.toolbarActionHandler(this.props.actionObj.action, evt);\n\t\t}\n\t}\n\n\tgenerateActionName() {\n\t\treturn this.props.actionObj.action + \"-action\";\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\tconst actionItemRect = this.divRef.current.getBoundingClientRect();\n\n\t\tif (this.props.actionObj.subPanel) {\n\t\t\treturn (\n\t\t\t\t<ToolbarSubPanel\n\t\t\t\t\tsubPanel={this.props.actionObj.subPanel}\n\t\t\t\t\tsubPanelData={this.props.actionObj.subPanelData}\n\t\t\t\t\tcloseSubArea={this.closeSubArea}\n\t\t\t\t\tactionItemRect={actionItemRect}\n\t\t\t\t\texpandDirection={\"horizontal\"}\n\t\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<ToolbarSubMenu\n\t\t\t\tsubMenuActions={this.props.actionObj.subMenu}\n\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\ttoolbarActionHandler={this.props.toolbarActionHandler}\n\t\t\t\tsetSubMenuFocus={this.props.setSubMenuFocus}\n\t\t\t\tcloseSubArea={this.closeSubArea}\n\t\t\t\tactionItemRect={actionItemRect}\n\t\t\t\texpandDirection={\"horizontal\"}\n\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\tparentSelector={this.generateSelector()}\n\t\t\t\tisCascadeMenu\n\t\t\t\tsize={this.props.size}\n\t\t\t/>\n\t\t);\n\t}\n\n\tgenerateSelector() {\n\t\treturn \".toolbar-sub-menu-item\";\n\t}\n\n\trender() {\n\t\tconst actionObj = this.props.actionObj;\n\t\tconst actionName = this.generateActionName();\n\t\tconst kindAsClass = actionObj.kind ? actionObj.kind : \"default\";\n\n\t\tconst itemClassName = classNames(\n\t\t\t{ \"toolbar-sub-menu-item\": true,\n\t\t\t\t\"toolbar-sub-menu-jsx-item\": 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.state.subAreaDisplayed ? this.generateSubArea() : null;\n\n\t\treturn (\n\t\t\t<div ref={this.divRef} className={itemClassName} data-toolbar-action={actionObj.action}\n\t\t\t\tonMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave} onKeyDown={this.onKeyDown}\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<ToolbarButtonItem\n\t\t\t\t\t\tactionObj={actionObj}\n\t\t\t\t\t\tactionName={this.generateActionName()}\n\t\t\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\t\t\tisInMenu\n\t\t\t\t\t\tsubAreaDisplayed={this.state.subAreaDisplayed}\n\t\t\t\t\t\tactionClickHandler={this.actionClickHandler}\n\t\t\t\t\t\tbuttonFocusAction={this.props.subMenuFocusAction}\n\t\t\t\t\t\tisFocusInToolbar // Focus must be in toolbar for this sub-menu item to appear\n\t\t\t\t\t\tsize={this.props.size}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{subArea}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nToolbarSubMenuItem.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\tcloseSubAreaOnClick: PropTypes.bool,\n\t\tleaveSubAreaOpenOnClickOutside: PropTypes.bool,\n\t\tsubMenu: PropTypes.array,\n\t\tsubPanel: PropTypes.any,\n\t\tsubPanelData: 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\ttoolbarActionHandler: PropTypes.func.isRequired,\n\tinstanceId: PropTypes.number.isRequired,\n\tcontainingDivId: PropTypes.string,\n\tcloseParentSubArea: PropTypes.func,\n\tsubMenuFocusAction: PropTypes.string,\n\tsetToolbarFocusAction: PropTypes.func,\n\tsetSubMenuFocus: PropTypes.func,\n\tisInOverflowMenu: PropTypes.bool,\n\tisInCascadeMenu: PropTypes.bool,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"])\n};\n\nexport default ToolbarSubMenuItem;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nclass ToolbarDividerItem extends React.Component {\n\trender() {\n\t\tconst dividerClassName = this.props.isInMenu ? \"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} tabIndex={-1} aria-hidden > </div>\n\t\t);\n\t}\n}\n\nToolbarDividerItem.propTypes = {\n\tisInMenu: PropTypes.bool\n};\n\nexport default ToolbarDividerItem;\n","/*\n * Copyright 2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport ToolbarSubMenuItem from \"./toolbar-sub-menu-item.jsx\";\nimport ToolbarDividerItem from \"./toolbar-divider-item\";\n\nimport { adjustSubAreaPosition, generateSubAreaStyle } from \"./toolbar-sub-utils.js\";\n\nconst ESC_KEY = 27;\nconst LEFT_ARROW_KEY = 37;\nconst UP_ARROW_KEY = 38;\nconst RIGHT_ARROW_KEY = 39;\nconst DOWN_ARROW_KEY = 40;\n\nclass ToolbarSubMenu extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tfocusAction: \"subarea\"\n\t\t};\n\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.setFocusAction = this.setFocusAction.bind(this);\n\t\tthis.setSubMenuFocus = this.setSubMenuFocus.bind(this);\n\t}\n\n\tcomponentDidMount() {\n\t\tif (this.props.containingDivId && this.props.subMenuActions.length > 0) {\n\t\t\tadjustSubAreaPosition(this.areaRef,\n\t\t\t\tthis.props.containingDivId, this.props.expandDirection, this.props.actionItemRect);\n\t\t}\n\n\t\tif (this.state.focusAction === \"subarea\") {\n\t\t\tthis.setFocusOnFirstItem();\n\t\t}\n\t}\n\n\tcomponentDidUpdate() {\n\t\tif (this.state.focusAction !== \"subarea\") {\n\t\t\tconst actionObj = this.props.subMenuActions.find((sma) => sma.action === this.state.focusAction);\n\t\t\tif (!actionObj?.enable) {\n\t\t\t\tconst actionToSet = this.getClosestEnabledAction(this.state.focusAction);\n\t\t\t\tif (actionToSet !== null) {\n\t\t\t\t\tthis.setFocusAction(actionToSet);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tonKeyDown(evt) {\n\t\tif (evt.keyCode === ESC_KEY) {\n\t\t\tthis.props.closeSubArea();\n\t\t\tevt.stopPropagation(); // Stop propagation in a case we are a cascade menu\n\n\t\t} else if (evt.keyCode === UP_ARROW_KEY) {\n\t\t\tthis.setFocusOnPreviousItem();\n\t\t\tevt.stopPropagation(); // Stop propagation in a case we are a cascade menu\n\n\t\t} else if (evt.keyCode === DOWN_ARROW_KEY) {\n\t\t\tthis.setFocusOnNextItem();\n\t\t\tevt.stopPropagation(); // Stop propagation in a case we are a cascade menu\n\n\t\t} else if (evt.keyCode === LEFT_ARROW_KEY) {\n\t\t\tevt.stopPropagation(); // Stop propagation in a case we are a cascade menu\n\n\t\t} else if (evt.keyCode === RIGHT_ARROW_KEY) {\n\t\t\tevt.stopPropagation(); // Stop propagation in a case we are a cascade menu\n\t\t}\n\t}\n\n\tsetFocusOnFirstItem() {\n\t\tconst focusableActions = this.getFocusableActions();\n\t\tif (focusableActions.length > 0) {\n\t\t\tthis.setFocusAction(focusableActions[0].action);\n\t\t}\n\t}\n\n\tsetFocusOnPreviousItem() {\n\t\tconst focusableActions = this.getFocusableActions();\n\t\tconst previousFocusAction = this.getPreviousFocusAction(focusableActions);\n\t\tif (previousFocusAction) {\n\t\t\tthis.setFocusAction(previousFocusAction.action);\n\t\t}\n\t}\n\n\tsetFocusOnNextItem() {\n\t\tconst focusableActions = this.getFocusableActions();\n\t\tconst nextFocusAction = this.getNextFocusAction(focusableActions);\n\t\tif (nextFocusAction) {\n\t\t\tthis.setFocusAction(nextFocusAction.action);\n\t\t}\n\t}\n\n\tsetFocusAction(focusAction) {\n\t\tthis.setState({ focusAction });\n\t}\n\n\tsetSubMenuFocus(action) {\n\t\tconst actionToSet = action || this.state.focusAction;\n\t\tthis.setFocusAction(actionToSet);\n\t}\n\n\tgetClosestEnabledAction(action) {\n\t\tconst index = this.props.subMenuActions.findIndex((sma) => sma.action === action);\n\t\tlet newAction = null;\n\t\tlet indexUp = index + 1;\n\t\tlet indexDown = index - 1;\n\n\t\twhile ((indexDown > -1 || indexUp < this.props.subMenuActions.length) && newAction === null) {\n\t\t\tif (indexDown > -1 && this.props.subMenuActions[indexDown].enable) {\n\t\t\t\tnewAction = this.props.subMenuActions[indexDown].action;\n\t\t\t} else {\n\t\t\t\tindexDown--;\n\t\t\t}\n\t\t\tif (indexUp < this.props.subMenuActions.length && this.props.subMenuActions[indexUp].enable) {\n\t\t\t\tnewAction = this.props.subMenuActions[indexUp].action;\n\t\t\t} else {\n\t\t\t\tindexUp++;\n\t\t\t}\n\t\t}\n\t\treturn newAction;\n\t}\n\n\tgetFocusableActions() {\n\t\tconst focusableActions = [];\n\n\t\tfor (let i = 0; i < this.props.subMenuActions.length; i++) {\n\t\t\tif (this.props.subMenuActions[i].enable || this.props.subMenuActions[i].jsx) {\n\t\t\t\tfocusableActions.push(this.props.subMenuActions[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn focusableActions;\n\t}\n\n\tgetPreviousFocusAction(focuableActions) {\n\t\tconst index = focuableActions.findIndex((fa) => fa.action === this.state.focusAction);\n\t\tif (index > 0) {\n\t\t\treturn focuableActions[index - 1];\n\t\t}\n\t\treturn focuableActions[focuableActions.length - 1];\n\t}\n\n\tgetNextFocusAction(focuableActions) {\n\t\tconst index = focuableActions.findIndex((fa) => fa.action === this.state.focusAction);\n\t\tif (index < focuableActions.length - 1) {\n\t\t\treturn focuableActions[index + 1];\n\t\t}\n\t\treturn focuableActions[0];\n\t}\n\n\t// Generates an array of JSX objects for a sub-menu defined by the\n\t// prop subMenuActions parameter array.\n\tgenerateSubMenuItems() {\n\t\tconst newItems = [];\n\n\t\tfor (let i = 0; i < this.props.subMenuActions.length; i++) {\n\t\t\tconst actionObj = this.props.subMenuActions[i];\n\t\t\tif (actionObj) {\n\t\t\t\tnewItems.push(this.generateSubMenuItem(actionObj, i));\n\t\t\t}\n\t\t}\n\t\treturn newItems;\n\t}\n\n\t// Returns JSX for a toolbar item based on the actionObj passed in.\n\tgenerateSubMenuItem(actionObj, i) {\n\t\tlet jsx = null;\n\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\tisInMenu\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tjsx = (\n\t\t\t\t\t<ToolbarSubMenuItem\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\ttoolbarActionHandler={this.props.toolbarActionHandler}\n\t\t\t\t\t\tcloseParentSubArea={this.props.closeSubArea}\n\t\t\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\t\t\tsubMenuFocusAction={this.state.focusAction}\n\t\t\t\t\t\tsetToolbarFocusAction={this.props.setToolbarFocusAction}\n\t\t\t\t\t\tsetSubMenuFocus={this.props.setSubMenuFocus ? this.props.setSubMenuFocus : this.setSubMenuFocus}\n\t\t\t\t\t\tsize={this.props.size}\n\t\t\t\t\t\tisInOverflowMenu={this.props.isOverflowMenu}\n\t\t\t\t\t\tisInCascadeMenu={this.props.isCascadeMenu}\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\trender() {\n\t\tif (this.props.subMenuActions.length > 0) {\n\t\t\tconst style = this.props.isCascadeMenu\n\t\t\t\t? generateSubAreaStyle(this.props.expandDirection, this.props.actionItemRect)\n\t\t\t\t: null;\n\n\t\t\tthis.subMenuItems = this.generateSubMenuItems();\n\n\t\t\treturn (\n\t\t\t\t<div ref={(ref) => (this.areaRef = ref)} style={style} className={\"toolbar-popover-list submenu\"}\n\t\t\t\t\ttabIndex={-1} onKeyDown={this.onKeyDown}\n\t\t\t\t>\n\t\t\t\t\t{this.subMenuItems}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n}\n\nToolbarSubMenu.propTypes = {\n\tsubMenuActions: PropTypes.array.isRequired,\n\tinstanceId: PropTypes.number.isRequired,\n\ttoolbarActionHandler: PropTypes.func,\n\tcloseSubArea: PropTypes.func,\n\tsetToolbarFocusAction: PropTypes.func,\n\tsetSubMenuFocus: PropTypes.func,\n\tactionItemRect: PropTypes.object,\n\texpandDirection: PropTypes.string.isRequired,\n\tcontainingDivId: PropTypes.string,\n\tparentSelector: PropTypes.string,\n\tisOverflowMenu: PropTypes.bool,\n\tisCascadeMenu: PropTypes.bool,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"])\n};\n\nexport default ToolbarSubMenu;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport ToolbarButtonItem from \"./toolbar-button-item.jsx\";\n\nimport classNames from \"classnames\";\nimport ToolbarSubMenu from \"./toolbar-sub-menu.jsx\";\nimport ToolbarSubPanel from \"./toolbar-sub-panel.jsx\";\n\nconst ESC_KEY = 27;\n\nclass ToolbarActionItem extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tsubAreaDisplayed: false\n\t\t};\n\n\t\tthis.divRef = React.createRef();\n\n\t\tthis.actionClickHandler = this.actionClickHandler.bind(this);\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.openSubArea = this.openSubArea.bind(this);\n\t\tthis.closeSubArea = this.closeSubArea.bind(this);\n\t\tthis.clickOutside = this.clickOutside.bind(this);\n\t}\n\n\t// We must remove the eventListener in case this class is unmounted due\n\t// to the toolbar getting redrawn.\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t}\n\n\tonKeyDown(evt) {\n\t\tif (evt.keyCode === ESC_KEY) {\n\t\t\tthis.closeSubArea();\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Called by toolbar.jsx\n\tgetBoundingRect() {\n\t\treturn this.divRef.current.getBoundingClientRect();\n\t}\n\n\t// Called by toolbar.jsx\n\tgetAction() {\n\t\treturn this.props.actionObj.action;\n\t}\n\n\t// Called by toolbar.jsx\n\tisEnabled() {\n\t\treturn this.props.actionObj.enable || this.props.actionObj.jsx;\n\t}\n\n\t// Called by toolbar.jsx and internally\n\tisSubAreaDisplayed() {\n\t\tif (this.props.actionObj.setExtIsSubAreaDisplayed &&\n\t\t\ttypeof this.props.actionObj.extIsSubAreaDisplayed !== \"undefined\") {\n\t\t\treturn this.props.actionObj.extIsSubAreaDisplayed;\n\t\t}\n\t\treturn this.state.subAreaDisplayed;\n\t}\n\n\tclickOutside(evt) {\n\t\tif (this.isSubAreaDisplayed()) {\n\t\t\tconst items = document.getElementsByClassName(this.generateActionName());\n\t\t\tconst isOver = items && items.length > 0 ? items[0].contains(evt.target) : false;\n\n\t\t\tif (!isOver && !this.props.actionObj.leaveSubAreaOpenOnClickOutside) {\n\t\t\t\tthis.closeSubArea();\n\t\t\t}\n\t\t}\n\t}\n\n\topenSubArea() {\n\t\t// If host app is controlling display of the sub-area call it to say\n\t\t// sub-area is closing.\n\t\tif (this.props.actionObj.setExtIsSubAreaDisplayed) {\n\t\t\tthis.props.actionObj.setExtIsSubAreaDisplayed(true);\n\t\t\treturn;\n\t\t}\n\t\tthis.setState({ subAreaDisplayed: true });\n\t}\n\n\tcloseSubArea(checkCloseSubAreaOnClick) {\n\t\tif (!checkCloseSubAreaOnClick || this.props.actionObj.closeSubAreaOnClick) {\n\t\t\t// If host app is controlling display of the sub-area call it to say\n\t\t\t// sub-area is closing.\n\t\t\tif (this.props.actionObj.setExtIsSubAreaDisplayed) {\n\t\t\t\tthis.props.actionObj.setExtIsSubAreaDisplayed(false);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.setState({ subAreaDisplayed: false });\n\t\t}\n\t}\n\n\tactionClickHandler(evt) {\n\t\tif (this.props.actionObj.subMenu || this.props.actionObj.subPanel) {\n\t\t\tif (this.isSubAreaDisplayed()) {\n\t\t\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t\t\t\tthis.closeSubArea();\n\t\t\t\tthis.props.setToolbarFocusAction(this.props.actionObj.action);\n\n\t\t\t} else {\n\t\t\t\tdocument.addEventListener(\"click\", this.clickOutside, false);\n\t\t\t\tthis.props.closeAnyOpenSubArea();\n\t\t\t\tthis.props.setToolbarFocusAction(this.props.actionObj.action);\n\t\t\t\tthis.openSubArea();\n\t\t\t}\n\n\t\t} else {\n\t\t\tthis.props.toolbarActionHandler(this.props.actionObj.action, evt);\n\t\t\tthis.props.setToolbarFocusAction(this.props.actionObj.action);\n\t\t}\n\t}\n\n\tgenerateActionName() {\n\t\treturn this.props.actionObj.action + \"-action\";\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\tconst actionItemRect = this.divRef.current ? this.divRef.current.getBoundingClientRect() : null;\n\n\t\tif (this.props.actionObj.subPanel) {\n\t\t\treturn (\n\t\t\t\t<ToolbarSubPanel\n\t\t\t\t\tsubPanel={this.props.actionObj.subPanel}\n\t\t\t\t\tsubPanelData={this.props.actionObj.subPanelData}\n\t\t\t\t\tcloseSubArea={this.closeSubArea}\n\t\t\t\t\tsetToolbarFocusAction={this.props.setToolbarFocusAction}\n\t\t\t\t\tactionItemRect={actionItemRect}\n\t\t\t\t\texpandDirection={\"vertical\"}\n\t\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<ToolbarSubMenu\n\t\t\t\tsubMenuActions={this.props.actionObj.subMenu}\n\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\ttoolbarActionHandler={this.props.toolbarActionHandler}\n\t\t\t\tcloseSubArea={this.closeSubArea}\n\t\t\t\tsetToolbarFocusAction={this.props.setToolbarFocusAction}\n\t\t\t\tactionItemRect={actionItemRect}\n\t\t\t\texpandDirection={\"vertical\"}\n\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\tparentSelector={this.generateSelector(this.props.actionObj)}\n\t\t\t\tisCascadeMenu={false}\n\t\t\t\tsize={this.props.size}\n\t\t\t/>\n\t\t);\n\t}\n\n\tgenerateSelector(actionObj) {\n\t\tif (actionObj.jsx) {\n\t\t\treturn \".toolbar-jsx-item\";\n\t\t}\n\t\treturn \".toolbar-item\";\n\t}\n\n\trender() {\n\t\tconst actionObj = this.props.actionObj;\n\t\tconst actionName = this.generateActionName();\n\t\tconst kindAsClass = actionObj.kind ? actionObj.kind : \"default\";\n\n\t\tconst itemClassName = classNames(\n\t\t\t{\n\t\t\t\t\"toolbar-item\": !actionObj.jsx,\n\t\t\t\t\"toolbar-jsx-item\": actionObj.jsx,\n\t\t\t\t\"toolbar-item-selected\": actionObj.isSelected\n\t\t\t},\n\t\t\tkindAsClass,\n\t\t\tactionName,\n\t\t\tthis.props.actionObj.className);\n\n\t\tconst subArea = this.isSubAreaDisplayed() ? this.generateSubArea() : null;\n\n\t\treturn (\n\t\t\t<div ref={this.divRef} className={itemClassName} data-toolbar-action={actionObj.action} data-toolbar-item\n\t\t\t\tonMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave} onKeyDown={this.onKeyDown}\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<ToolbarButtonItem\n\t\t\t\t\t\tactionObj={actionObj}\n\t\t\t\t\t\tactionName={this.generateActionName()}\n\t\t\t\t\t\ttooltipDirection={this.props.tooltipDirection}\n\t\t\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\t\t\tisInMenu={false}\n\t\t\t\t\t\tsubAreaDisplayed={this.isSubAreaDisplayed()}\n\t\t\t\t\t\tactionClickHandler={this.actionClickHandler}\n\t\t\t\t\t\tbuttonFocusAction={this.isSubAreaDisplayed() ? null : this.props.toolbarFocusAction}\n\t\t\t\t\t\tisFocusInToolbar={this.props.isFocusInToolbar}\n\t\t\t\t\t\tsize={this.props.size}\n\t\t\t\t\t/>\n\t\t\t\t</div>\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\tsetExtIsSubAreaDisplayed: PropTypes.func,\n\t\textIsSubAreaDisplayed: PropTypes.bool,\n\t\tkind: PropTypes.string,\n\t\tcloseSubAreaOnClick: PropTypes.bool,\n\t\tleaveSubAreaOpenOnClickOutside: PropTypes.bool,\n\t\tsubMenu: PropTypes.array,\n\t\tsubPanel: PropTypes.any,\n\t\tsubPanelData: PropTypes.object,\n\t\tjsx: PropTypes.oneOfType([\n\t\t\tPropTypes.object,\n\t\t\tPropTypes.func\n\t\t]),\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\tinstanceId: PropTypes.number.isRequired,\n\tcontainingDivId: PropTypes.string,\n\tcloseParentSubArea: PropTypes.func,\n\ttoolbarFocusAction: PropTypes.string,\n\tsetToolbarFocusAction: PropTypes.func,\n\tisFocusInToolbar: PropTypes.bool,\n\tcloseAnyOpenSubArea: PropTypes.func,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"])\n};\n\nexport default ToolbarActionItem;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { v4 as uuid4 } from \"uuid\";\nimport { Button } from \"carbon-components-react\";\nimport { OverflowMenuVertical16 } from \"@carbon/icons-react\";\nimport ToolbarSubMenu from \"./toolbar-sub-menu.jsx\";\n\nclass ToolbarOverflowItem extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tshowExtendedMenu: false\n\t\t};\n\n\t\tthis.buttonRef = React.createRef();\n\n\t\tthis.uuid = uuid4();\n\t\tthis.toggleExtendedMenu = this.toggleExtendedMenu.bind(this);\n\t\tthis.clickOutside = this.clickOutside.bind(this);\n\t\tthis.closeSubArea = this.closeSubArea.bind(this);\n\t}\n\n\tcomponentDidUpdate() {\n\t\tif (this.props.toolbarFocusAction === this.props.action && this.props.isFocusInToolbar && !this.state.showExtendedMenu) {\n\t\t\tthis.buttonRef.current.focus();\n\t\t}\n\t}\n\n\t// We must remove the eventListener in case this class is unmounted due\n\t// to the toolbar getting redrawn.\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t}\n\n\t// Called by toolbar.jsx\n\tgetAction() {\n\t\treturn this.props.action;\n\t}\n\n\t// Called by toolbar.jsx\n\tisSubAreaDisplayed() {\n\t\treturn this.state.showExtendedMenu;\n\t}\n\n\t// Called by toolbar.jsx and internally\n\tcloseSubArea() {\n\t\tthis.setState({ showExtendedMenu: false });\n\t}\n\n\topenSubMenu() {\n\t\tthis.setState({ showExtendedMenu: true });\n\t}\n\n\tgenOverflowButtonClassName() {\n\t\treturn \"toolbar-overflow-container \" + this.genIndexClassName() + \" \" + this.genUuidClassName();\n\t}\n\n\tgenIndexClassName() {\n\t\treturn \"toolbar-index-\" + this.props.index;\n\t}\n\n\tgenUuidClassName() {\n\t\treturn \"toolbar-uuid-\" + this.uuid;\n\t}\n\n\t// When the overflow item is clicked to open the overflow menu we must set the\n\t// index of the overflow items so the overflow menu can be correctly constructed.\n\t// The overflow index values are used to split out the overflow menu action items\n\t// from the left bar and right bar.\n\t// When the overflow menu is closed we set the overflow index values to null.\n\ttoggleExtendedMenu() {\n\t\tif (this.state.showExtendedMenu) {\n\t\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t\t\tthis.props.setOverflowIndex(null); // Clear the indexes\n\t\t\tthis.closeSubArea();\n\t\t\tthis.props.setToolbarFocusAction(this.props.action); // This will not set focus on this item\n\n\t\t} else {\n\t\t\tdocument.addEventListener(\"click\", this.clickOutside, false);\n\t\t\tthis.props.closeAnyOpenSubArea();\n\t\t\tthis.props.setOverflowIndex(this.props.index);\n\t\t\tthis.openSubMenu();\n\t\t\tthis.props.setToolbarFocusAction(this.props.action);\n\t\t}\n\t}\n\n\tclickOutside(evt) {\n\t\tif (this.state.showExtendedMenu) {\n\t\t\t// Selector for the overflow-container that contains the overflow icon\n\t\t\t// and submenu (if submenu is open).\n\t\t\tconst selector = \".\" + this.genIndexClassName();\n\t\t\tconst isClickInOverflowContainer = evt.target.closest(selector);\n\t\t\tif (!isClickInOverflowContainer) {\n\t\t\t\tthis.setState({ showExtendedMenu: false });\n\t\t\t}\n\t\t}\n\t}\n\n\trender() {\n\t\tlet overflowMenu = null;\n\t\tif (this.state.showExtendedMenu) {\n\t\t\tconst actionItemRect = this.buttonRef.current.getBoundingClientRect();\n\t\t\toverflowMenu = (\n\t\t\t\t<ToolbarSubMenu\n\t\t\t\t\tref={this.subMenuRef}\n\t\t\t\t\tsubMenuActions={this.props.subMenuActions}\n\t\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\t\ttoolbarActionHandler={this.props.toolbarActionHandler}\n\t\t\t\t\tcloseSubArea={this.closeSubArea}\n\t\t\t\t\tsetToolbarFocusAction={this.props.setToolbarFocusAction}\n\t\t\t\t\tactionItemRect={actionItemRect}\n\t\t\t\t\texpandDirection={\"vertical\"}\n\t\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\t\tparentSelector={\".toolbar-overflow-container\"}\n\t\t\t\t\tisOverflowMenu\n\t\t\t\t\tisCascadeMenu={false}\n\t\t\t\t\tsize={this.props.size}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tconst tabIndex = this.props.toolbarFocusAction === this.props.action ? 0 : -1;\n\n\t\treturn (\n\t\t\t<div className={this.genOverflowButtonClassName()} data-toolbar-action={this.props.action}>\n\t\t\t\t<div className={\"toolbar-overflow-item\"}>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={this.buttonRef}\n\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t\t\tonClick={this.toggleExtendedMenu}\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\tindex: PropTypes.number.isRequired,\n\taction: PropTypes.string,\n\tlabel: PropTypes.string,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"]),\n\tsubMenuActions: PropTypes.array,\n\tsetOverflowIndex: PropTypes.func,\n\ttoolbarActionHandler: PropTypes.func,\n\tinstanceId: PropTypes.number.isRequired,\n\tcontainingDivId: PropTypes.string,\n\ttoolbarFocusAction: PropTypes.string,\n\tsetToolbarFocusAction: PropTypes.func,\n\tisFocusInToolbar: PropTypes.bool,\n\tcloseAnyOpenSubArea: PropTypes.func\n};\n\nexport default ToolbarOverflowItem;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\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\nconst ESC_KEY = 27;\nconst LEFT_ARROW_KEY = 37;\nconst RIGHT_ARROW_KEY = 39;\n\nclass Toolbar extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\t// this.state.focusAction keeps track of which item has focus.\n\t\t// This is used to ensure the focus goes to the same item that was\n\t\t// previously focused when focus was lost (blurred) from the toolbar\n\t\t// Index values (leftOverflowIndex and rightOverflowIndex) are used\n\t\t// to keep track of how the left and right bar arrays\n\t\t// should be split to be able to create the overflow menu.\n\t\tthis.state = {\n\t\t\tfocusAction: \"toolbar\",\n\t\t\tleftOverflowIndex: null,\n\t\t\trightOverflowIndex: null,\n\t\t};\n\n\t\t// Keeps track of whether the focus is on the toolbar or not. We should\n\t\t// not call focus() on any item in the toolbar if this.isFocusInToolbar\n\t\t// is false, otherwise focus will be moved incorrectly to the toolbar\n\t\t// and away from its current location.\n\t\tthis.isFocusInToolbar = false;\n\n\t\t// Arrays to hold the left and right bar configurations\n\t\tthis.leftBar = [];\n\t\tthis.rightBar = [];\n\n\t\t// Arrays to store references to React objects in toolbar for the\n\t\t// the left bar, right bar and current set of overflow items.\n\t\tthis.leftItemRefs = [];\n\t\tthis.rightItemRefs = [];\n\t\tthis.overflowItemRefs = [];\n\n\t\t// Reference for the toolbar <div>\n\t\tthis.toolbarRef = React.createRef();\n\n\t\tthis.onFocus = this.onFocus.bind(this);\n\t\tthis.onBlur = this.onBlur.bind(this);\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.onToolbarResize = this.onToolbarResize.bind(this);\n\t\tthis.setOverflowIndex = this.setOverflowIndex.bind(this);\n\t\tthis.generateToolbarItems = this.generateToolbarItems.bind(this);\n\t\tthis.setFocusAction = this.setFocusAction.bind(this);\n\t\tthis.setFocusOnItem = this.setFocusOnItem.bind(this);\n\t\tthis.closeAnyOpenSubArea = this.closeAnyOpenSubArea.bind(this);\n\t}\n\n\t// If, after updating, we are left in a situation where this.state.focusAction\n\t// is for an item that is NOT focusable, then set the focus on the first focusable\n\t// item. This might happen when an item with focus is activated and the action it\n\t// performs causes itself to become disabled. For example, if the delete item is\n\t// activated the selected objects are deleted and since no objects are now selected\n\t// the delete item (which has focus) will become disabled. It may also happen if the\n\t// toolbar config is updated and the current focusAction item is removed.\n\tcomponentDidUpdate() {\n\t\tconst index = this.getFocusableItemRefs().findIndex((item) => this.getRefAction(item) === this.state.focusAction);\n\t\tif (index === -1) {\n\t\t\tthis.setFocusOnFirstItem();\n\t\t}\n\t}\n\n\t// When the toolbar is initially focused, this.state.focusAction\n\t// will be set to the default of \"toolbar\". In that case we set the\n\t// focus on the first focusable toolbar item.\n\tonFocus(evt) {\n\t\tthis.isFocusInToolbar = true;\n\n\t\t// If focus occurs because of a click on the toolbar body\n\t\t// (not on a button) and no button has focus move focus to\n\t\t// the first item otherwise just keep focus the same.\n\t\tif (evt.target?.classList?.contains(\"toolbar-div\")) {\n\t\t\tif (this.state.focusAction === \"toolbar\") {\n\t\t\t\tthis.setFocusOnFirstItem();\n\n\n\t\t\t} else {\n\t\t\t\tthis.setFocusOnItem(); // Reset focus on current focusAction.\n\t\t\t}\n\t\t}\n\t}\n\n\t// When focus leaves the toolbar make sure we record it. This prevents\n\t// us accidentally setting focus on a toolbar item when the toolbar\n\t// re-renders with the focus elsewhere.\n\tonBlur(evt) {\n\t\t// If the focus is being moved to an object outside the toolbar div\n\t\t// we set isFocusInToolbar to false.\n\t\tif (!evt.relatedTarget?.closest(\".toolbar-div\")) {\n\t\t\tthis.isFocusInToolbar = false;\n\t\t}\n\t}\n\n\t// This is called when the user presses a key with focus on one of the\n\t// toolbar items. We set the focusAction appropriately based on which\n\t// key is pressed.\n\tonKeyDown(evt) {\n\t\tif (evt.keyCode === ESC_KEY) {\n\t\t\tthis.setFocusOnItem(); // Reset focus on current focusAction.\n\n\t\t} else if (evt.keyCode === LEFT_ARROW_KEY) {\n\t\t\tthis.setFocusOnPreviousItem();\n\n\t\t} else if (evt.keyCode === RIGHT_ARROW_KEY) {\n\t\t\tthis.setFocusOnNextItem();\n\t\t}\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// When the toolbar resizes, check each toolbar item to see if it has\n\t// an open sub-area and, if that item is not a focusable item, close\n\t// the sub-area. The item may no longer be focusable it is it was wrapped\n\t// into the overflow menu. Also, check to see if the current focus action\n\t// item is focusable and, if not, set focus on the first focusable item.\n\tonToolbarResize() {\n\t\tconst focusableItemRefs = this.getFocusableItemRefs();\n\t\t// Note: isFocusActionFocusable needs to be calculated here before any\n\t\t// update to the toolbar caused by the code in the subsequent if ststement.\n\t\tconst isFocusActionFocusable = this.isFocusActionFocusable(this.state.focusAction, focusableItemRefs);\n\t\tconst refWithOpenSubArea = this.getRefWithOpenSubArea();\n\n\t\tif (refWithOpenSubArea) {\n\t\t\tconst action = refWithOpenSubArea.current.getAction();\n\t\t\tconst isFocusActionWithOpenSubAreaFocusable = this.isFocusActionFocusable(action, focusableItemRefs);\n\n\t\t\tif (!isFocusActionWithOpenSubAreaFocusable) {\n\t\t\t\trefWithOpenSubArea.current.closeSubArea();\n\n\t\t\t} else {\n\t\t\t\t// This forces a refresh that will cause the position of any\n\t\t\t\t// open sub-area to be recaulculated based on the new toolbar width.\n\t\t\t\tthis.setFocusAction(this.state.focusAction);\n\t\t\t}\n\t\t}\n\n\t\t// If the focus action item is not focusable (maybe because it has been\n\t\t// moved into the overflow menu) then set focus on the first focusable item.\n\t\tif (!isFocusActionFocusable) {\n\t\t\tthis.setFocusOnFirstItem();\n\t\t}\n\t}\n\n\t// Returns the ref to any item that currently has an open sub-area or null\n\t// if no item has an open sub-area.\n\tgetRefWithOpenSubArea() {\n\t\tlet subAreaOpenRef = this.leftItemRefs.find((ref) => ref.current.isSubAreaDisplayed());\n\t\tif (!subAreaOpenRef) {\n\t\t\tsubAreaOpenRef = this.rightItemRefs.find((ref) => ref.current.isSubAreaDisplayed());\n\t\t}\n\t\tif (!subAreaOpenRef) {\n\t\t\tsubAreaOpenRef = this.overflowItemRefs.find((ref) => ref.current.isSubAreaDisplayed());\n\t\t}\n\t\treturn subAreaOpenRef;\n\t}\n\n\t// Either sets the focus on the item for the action passed in or, if\n\t// no action is passed in, set the focus on the current focusAction.\n\t// Setting the current focusAction is used to return focus back to an\n\t// item after focus has been moved elsewhere, such as onto a sub-menu\n\t// or out of the toolbar completely.\n\tsetFocusOnItem(action) {\n\t\tconst actionToSet = action || this.state.focusAction;\n\t\tconst focusableItemRefs = this.getFocusableItemRefs();\n\t\tif (focusableItemRefs.length > 0) {\n\t\t\tthis.setFocusAction(actionToSet);\n\t\t}\n\t}\n\n\tsetFocusOnFirstItem() {\n\t\tconst focusableItemRefs = this.getFocusableItemRefs();\n\t\tif (focusableItemRefs.length > 0) {\n\t\t\tconst firstFocusAction = this.getRefAction(focusableItemRefs[0]);\n\t\t\tthis.setFocusAction(firstFocusAction);\n\t\t}\n\t}\n\n\tsetFocusOnPreviousItem() {\n\t\tconst focusableItemRefs = this.getFocusableItemRefs();\n\t\tconst previousRef = this.getPreviousItemRef(focusableItemRefs);\n\t\tif (previousRef) {\n\t\t\tconst previousFocusAction = this.getRefAction(previousRef);\n\t\t\tthis.setFocusAction(previousFocusAction);\n\t\t}\n\t}\n\n\tsetFocusOnNextItem() {\n\t\tconst focusableItemRefs = this.getFocusableItemRefs();\n\t\tconst nextRef = this.getNextItemRef(focusableItemRefs);\n\t\tif (nextRef) {\n\t\t\tconst nextFocusAction = this.getRefAction(nextRef);\n\t\t\tthis.setFocusAction(nextFocusAction);\n\t\t}\n\t}\n\n\tsetFocusAction(focusAction) {\n\t\tthis.setState({ focusAction });\n\t}\n\n\tgetPreviousItemRef(focusableItemRefs) {\n\t\tconst index = focusableItemRefs.findIndex((item) => this.getRefAction(item) === this.state.focusAction);\n\t\tif (index === 0) {\n\t\t\treturn focusableItemRefs[focusableItemRefs.length - 1];\n\t\t}\n\t\treturn focusableItemRefs[index - 1];\n\t}\n\n\tgetNextItemRef(focusableItemRefs) {\n\t\tconst index = focusableItemRefs.findIndex((item) => this.getRefAction(item) === this.state.focusAction);\n\t\tif (index === focusableItemRefs.length - 1) {\n\t\t\treturn focusableItemRefs[0];\n\t\t}\n\t\treturn focusableItemRefs[index + 1];\n\t}\n\n\tgetRefAction(ref) {\n\t\treturn ref.current.getAction();\n\t}\n\n\t// Returns an array of references to focusable (that is enabled)\n\t// toolbar items that are on the top (visible) row of the toolbar.\n\tgetFocusableItemRefs() {\n\t\treturn this.getLeftBarFocusableItemRefs().concat(this.getRightBarFocusableItemRefs());\n\t}\n\n\t// Returns an array of references to left bar items that are\n\t// on the top (visible) row of the toolbar and are focusable.\n\t// That is, not disabled. In addition, there may also be a\n\t// reference to an overflow item if one is visible on the\n\t// top (visible) row of the toolbar.\n\tgetLeftBarFocusableItemRefs() {\n\t\tconst focusableItemRefs = [];\n\n\t\tif (this.leftItemRefs.length === 0) {\n\t\t\treturn focusableItemRefs;\n\t\t}\n\n\t\tconst topRowY = this.findToolbarTopYCoordinate();\n\t\tlet overflowItemRef = null;\n\n\t\tfor (let i = 0; i < this.leftItemRefs.length; i++) {\n\t\t\tconst itemRect = this.leftItemRefs[i].current.getBoundingRect();\n\n\t\t\tif (itemRect.top === topRowY) {\n\t\t\t\tif (this.leftItemRefs[i].current.isEnabled()) {\n\t\t\t\t\tfocusableItemRefs.push(this.leftItemRefs[i]);\n\t\t\t\t}\n\n\t\t\t} else if (!overflowItemRef) {\n\t\t\t\tconst leftRefAction = this.getRefAction(this.leftItemRefs[i]);\n\t\t\t\tconst overflowAction = this.getOverflowAction(leftRefAction);\n\t\t\t\toverflowItemRef = this.overflowItemRefs.find((oRef) => oRef.current.getAction() === overflowAction);\n\t\t\t\tif (overflowItemRef) {\n\t\t\t\t\tfocusableItemRefs.push(overflowItemRef);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn focusableItemRefs;\n\t}\n\n\t// Returns an array of references to right bar items that are\n\t// on the top (visible) row of the toolbar and are focusable.\n\t// That is, not disabled.\n\tgetRightBarFocusableItemRefs() {\n\t\tconst focusableItemRefs = [];\n\n\t\tif (this.rightItemRefs === 0) {\n\t\t\treturn focusableItemRefs;\n\t\t}\n\n\t\tconst topRowY = this.findToolbarTopYCoordinate();\n\n\t\tfor (let i = 0; i < this.rightItemRefs.length; i++) {\n\t\t\tif (this.rightItemRefs[i].current.isEnabled()) {\n\t\t\t\tconst refRect = this.rightItemRefs[i].current.getBoundingRect();\n\n\t\t\t\tif (refRect.top === topRowY) {\n\t\t\t\t\tfocusableItemRefs.push(this.rightItemRefs[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn focusableItemRefs.reverse();\n\t}\n\n\t// Items that appear in the overflow menu need unique action names because\n\t// the original action item to which they are related will still exist, but\n\t// hidden, in the toolbar.\n\tgetOverflowAction(action) {\n\t\treturn \"overflow_\" + action;\n\t}\n\n\t// Sets two index values: one for the left bar and one for the right that\n\t// indicate which elements in each array should be put in the overflow menu.\n\t// That is, those elements that do not appear on the top (visible) row of the\n\t// toolbar.\n\tsetOverflowIndex(leftIndex) {\n\t\tif (leftIndex === null) {\n\t\t\tthis.setState({\n\t\t\t\tleftOverflowIndex: null,\n\t\t\t\trightOverflowIndex: null\n\t\t\t});\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tleftOverflowIndex: leftIndex,\n\t\t\t\trightOverflowIndex: this.getRightOverflowIndex()\n\t\t\t});\n\t\t}\n\t}\n\n\t// Returns the index of the first item in the right bar that is\n\t// not on the top (visible) row of the toolbar.\n\tgetRightOverflowIndex() {\n\t\tconst ref = this.findFirstRightItemRefNotOnTopRow();\n\n\t\tconst index = ref === null\n\t\t\t? this.rightBar.length - 1\n\t\t\t: this.rightBar.findIndex((ri) => ri.action === this.getRefAction(ref));\n\n\t\treturn index;\n\t}\n\n\t// Returns true of the current focus action item is one of the focusable\n\t// items. (It may not be if it has been placed in the overflow menu).\n\tisFocusActionFocusable(focusAction, focusableItemRefs) {\n\t\tconst indexFocusAction = focusableItemRefs.findIndex((ref) =>\n\t\t\tref.current.props.actionObj?.action === focusAction);\n\t\treturn indexFocusAction > -1;\n\t}\n\n\t// Returns a reference to the first item that is not on the\n\t// top (visible) row of the toolbar.\n\tfindFirstRightItemRefNotOnTopRow() {\n\t\tconst topRowY = this.findToolbarTopYCoordinate();\n\n\t\tlet rightItemRef = null;\n\n\t\tfor (let i = 0; i < this.rightItemRefs.length; i++) {\n\t\t\tconst itemRect = this.rightItemRefs[i].current.getBoundingRect();\n\t\t\tif (itemRect.top !== topRowY && rightItemRef === null) {\n\t\t\t\trightItemRef = this.rightItemRefs[i];\n\t\t\t}\n\t\t}\n\t\treturn rightItemRef;\n\t}\n\n\t// Returns the Y coordinate of the top of the toolbar. This is\n\t// used to detecg which toolbar items are on the top (visible)\n\t// row and which are wrapped onto other rows.\n\tfindToolbarTopYCoordinate() {\n\t\tconst rect = this.toolbarRef.current.getBoundingClientRect();\n\t\treturn rect.top;\n\t}\n\n\t// Generates an array of toolbar items from the toolbarActions array passed in. When\n\t// withOverflowItem is true, which it is for the left bar, we also add an overflow item,\n\t// inside an overflow item container, for each left toolbar action. As the canvas is made\n\t// narrower the regular action items wrap onto a second (hidden) row of the toolbar and\n\t// the overflow item, associated with the last wrapped action item, is revealed.\n\tgenerateToolbarItems(toolbarActions, withOverflowItem, refs) {\n\t\tconst newItems = [];\n\n\t\tfor (let i = 0; i < toolbarActions.length; i++) {\n\t\t\tconst actionObj = toolbarActions[i];\n\t\t\tif (actionObj) {\n\t\t\t\tif (!actionObj.divider && withOverflowItem) {\n\t\t\t\t\tnewItems.push(this.generateOverflowItem(i, actionObj.action));\n\t\t\t\t}\n\t\t\t\tnewItems.push(this.generateToolbarItem(actionObj, i, refs));\n\t\t\t}\n\t\t}\n\t\treturn newItems;\n\t}\n\n\t// Returns JSX for a toolbar item based on the actionObj passed in.\n\tgenerateToolbarItem(actionObj, i, refs) {\n\t\tlet jsx = null;\n\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\tisInMenu={false}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst ref = React.createRef();\n\t\t\t\tif (refs) {\n\t\t\t\t\trefs.push(ref);\n\t\t\t\t}\n\t\t\t\tjsx = (\n\t\t\t\t\t<ToolbarActionItem\n\t\t\t\t\t\tref={ref}\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\tinstanceId={this.props.instanceId}\n\t\t\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\t\t\ttoolbarFocusAction={this.state.focusAction}\n\t\t\t\t\t\tsetToolbarFocusAction={this.setFocusOnItem}\n\t\t\t\t\t\tisFocusInToolbar={this.isFocusInToolbar}\n\t\t\t\t\t\tcloseAnyOpenSubArea={this.closeAnyOpenSubArea}\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\t// Returns JSX for an overflow toolbar item based on the index and action passed in.\n\tgenerateOverflowItem(index, action) {\n\t\tconst label = this.props.additionalText ? this.props.additionalText.overflowMenuLabel : \"\";\n\t\tconst overflowAction = this.getOverflowAction(action);\n\t\tconst subMenuActions = index === this.state.leftOverflowIndex ? this.createSubMenuActions() : [];\n\n\t\t// Create a ref for the overflow item to add to array of references to\n\t\t// all overflow items.\n\t\tconst ref = React.createRef();\n\t\tthis.overflowItemRefs.push(ref);\n\n\t\tconst jsx = (\n\t\t\t<ToolbarOverflowItem\n\t\t\t\tref={ref}\n\t\t\t\tkey={\"toolbar-overflow-item-key-\" + index}\n\t\t\t\tindex={index}\n\t\t\t\taction={overflowAction}\n\t\t\t\tlabel={label}\n\t\t\t\tsize={this.props.size}\n\t\t\t\tsubMenuActions={subMenuActions}\n\t\t\t\tsetOverflowIndex={this.setOverflowIndex}\n\t\t\t\ttoolbarActionHandler={this.props.toolbarActionHandler}\n\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\ttoolbarFocusAction={this.state.focusAction}\n\t\t\t\tsetToolbarFocusAction={this.setFocusOnItem}\n\t\t\t\tisFocusInToolbar={this.isFocusInToolbar}\n\t\t\t\tcloseAnyOpenSubArea={this.closeAnyOpenSubArea}\n\t\t\t/>\n\t\t);\n\n\t\treturn jsx;\n\t}\n\n\t// Returns an array of overflow menu actions that should be displayed in\n\t// the overflow menu for the overflow item indicated by the index passed in.\n\t// This uses this.state.leftOverflowIndex and this.state.rightOverflowIndex which are\n\t// set when the user clicks on a particular overflow item in the toolbar.\n\tcreateSubMenuActions() {\n\t\tlet subMenuActions = [];\n\t\tconst l = this.leftBar.slice(this.state.leftOverflowIndex);\n\t\tconst r = this.rightBar.slice(this.state.rightOverflowIndex).reverse();\n\t\tsubMenuActions = l.concat(r);\n\n\t\treturn subMenuActions;\n\t}\n\n\tcloseAnyOpenSubArea() {\n\t\tthis.leftItemRefs.forEach((ref) => this.closeSubAreaOnRef(ref));\n\t\tthis.rightItemRefs.forEach((ref) => this.closeSubAreaOnRef(ref));\n\t\tthis.overflowItemRefs.forEach((ref) => this.closeOverflowMenuOnRef(ref));\n\t}\n\n\tcloseSubAreaOnRef(ref) {\n\t\tif (ref.current.props.actionObj.setExtIsSubAreaDisplayed) {\n\t\t\tref.current.props.actionObj.setExtIsSubAreaDisplayed(false);\n\n\t\t} else if (ref.current.state.subAreaDisplayed) {\n\t\t\tref.current.closeSubArea();\n\t\t}\n\t}\n\n\tcloseOverflowMenuOnRef(ref) {\n\t\tif (ref.current.state.showExtendedMenu) {\n\t\t\tref.current.closeSubArea();\n\t\t}\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\t// Arrays to store references to React objects in toolbar.\n\t\tthis.leftItemRefs = [];\n\t\tthis.rightItemRefs = [];\n\t\tthis.overflowItemRefs = [];\n\n\t\tconst leftItems = this.generateToolbarItems(this.leftBar, true, this.leftItemRefs);\n\t\tconst rightItems = this.generateToolbarItems(this.rightBar, false, this.rightItemRefs);\n\n\t\tconst toolbarSizeClass = this.props.size === \"sm\" ? \"toolbar-div toolbar-size-small\" : \"toolbar-div\";\n\t\tconst tabIndex = this.state.focusAction === \"toolbar\" ? 0 : -1;\n\n\t\tconst canvasToolbar = (\n\t\t\t<ReactResizeDetector handleWidth onResize={this.onToolbarResize}>\n\t\t\t\t<div ref={this.toolbarRef} className={toolbarSizeClass} instanceid={this.props.instanceId}\n\t\t\t\t\ttabIndex={tabIndex} onFocus={this.onFocus} onBlur={this.onBlur} onKeyDown={this.onKeyDown}\n\t\t\t\t>\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.isRequired,\n\tcontainingDivId: PropTypes.string,\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","toNumber","require$$0","INFINITY","toFinite","toInteger_1","result","remainder","_React$Component","ToolbarButtonItem","props","_this","_classCallCheck","_callSuper","buttonRef","React","createRef","_inherits","_createClass","key","this","isFocusInToolbar","buttonFocusAction","actionObj","action","jsxItem","current","querySelector","focus","disabled","enable","TOOLBAR_STOP","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_CLIPBOARD","Result16","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","CenterToFit16","TOOLBAR_OPEN_PALETTE","TOOLBAR_CLOSE_PALETTE","TOOLBAR_TOGGLE_PALETTE","OpenPanelFilledLeft16","TOOLBAR_ARRANGE_HORIZONALLY","SVG","src","TOOLBAR_ARRANGE_VERTICALLY","TOOLBAR_TOGGLE_NOTIFICATION_PANEL","label","disable","isInMenu","incLabelWithIcon","className","generateLabelType","inLabelWithIcon","icon","getDefaultIcon","iconEnabled","iconDisabled","customIcon","id","instanceId","labelBefore","labelAfter","generateLabel","generateIcon","textContent","itemContentClassName","classNames","overflow","default","kind","chevronIcon","generateChevronIcon","buttonContent","wrapInTooltip","ariaLabel","tabIndex","Button","ref","onClick","actionClickHandler","size","subMenu","subPanel","ChevronRight16","chev","subAreaDisplayed","ChevronUp16","ChevronDown16","generateChevronMini","path","d","content","jsx","showLabelAsTip","tooltip","tip","tooltipId","actionName","enableTooltip","direction","tooltipDirection","Tooltip","generateJsxItem","generateRegularItem","Component","adjustSubAreaPosition","areaRef","containingDivId","expandDirection","actionItemRect","containingDiv","document","getElementById","containingDivRect","getBoundingClientRect","top","bottom","left","right","thisAreaRect","outsideBottom","outsideRight","newTop","height","style","newLeft","width","generateSubAreaStyle","ToolbarSubPanel","onKeyDown","bind","closeSubPanel","evt","keyCode","closeSubArea","stopPropagation","preventDefault","_this2","onFocus","subPanelData","ToolbarSubMenuItem","state","divRef","onMouseEnter","onMouseLeave","openSubArea","clickOutside","removeEventListener","items","getElementsByClassName","generateActionName","contains","target","leaveSubAreaOpenOnClickOutside","setState","checkCloseSubAreaOnClick","closeSubAreaOnClick","addEventListener","isInCascadeMenu","closeParentSubArea","setSubMenuFocus","isInOverflowMenu","setToolbarFocusAction","toolbarActionHandler","ToolbarSubMenu","subMenuActions","parentSelector","generateSelector","isCascadeMenu","kindAsClass","itemClassName","isSelected","subArea","generateSubArea","subMenuFocusAction","ToolbarDividerItem","arguments","dividerClassName","focusAction","setFocusAction","setFocusOnFirstItem","find","sma","actionToSet","getClosestEnabledAction","setFocusOnPreviousItem","setFocusOnNextItem","focusableActions","getFocusableActions","previousFocusAction","getPreviousFocusAction","nextFocusAction","getNextFocusAction","findIndex","newAction","indexUp","indexDown","i","push","focuableActions","_this3","fa","_this4","newItems","generateSubMenuItem","divider","isOverflowMenu","_this5","subMenuItems","generateSubMenuItems","ToolbarActionItem","setExtIsSubAreaDisplayed","extIsSubAreaDisplayed","isSubAreaDisplayed","closeAnyOpenSubArea","toolbarFocusAction","ToolbarOverflowItem","showExtendedMenu","uuid","uuid4","toggleExtendedMenu","genIndexClassName","genUuidClassName","setOverflowIndex","openSubMenu","selector","closest","overflowMenu","subMenuRef","genOverflowButtonClassName","OverflowMenuVertical16","Toolbar","leftOverflowIndex","rightOverflowIndex","leftBar","rightBar","leftItemRefs","rightItemRefs","overflowItemRefs","toolbarRef","onBlur","onToolbarResize","generateToolbarItems","setFocusOnItem","getFocusableItemRefs","item","getRefAction","_evt$target","_evt$target$classList","classList","_evt$relatedTarget","relatedTarget","currentTarget","scroll","focusableItemRefs","isFocusActionFocusable","refWithOpenSubArea","getRefWithOpenSubArea","getAction","subAreaOpenRef","firstFocusAction","previousRef","getPreviousItemRef","nextRef","getNextItemRef","getLeftBarFocusableItemRefs","concat","getRightBarFocusableItemRefs","topRowY","findToolbarTopYCoordinate","overflowItemRef","_loop","getBoundingRect","isEnabled","leftRefAction","overflowAction","getOverflowAction","oRef","reverse","leftIndex","getRightOverflowIndex","_this6","findFirstRightItemRefNotOnTopRow","ri","_ref$current$props$ac","rightItemRef","toolbarActions","withOverflowItem","refs","generateOverflowItem","generateToolbarItem","additionalText","overflowMenuLabel","createSubMenuActions","l","r","_this7","forEach","closeSubAreaOnRef","closeOverflowMenuOnRef","config","_toConsumableArray","leftItems","rightItems","toolbarSizeClass","ReactResizeDetector","handleWidth","onResize","instanceid","onScroll"],"mappings":"4pCACA,IAAIA,GAAe,SCDfC,GDWJ,SAAyBC,GAGvB,IAFA,IAAIC,EAAQD,EAAOE,OAEZD,KAAWH,GAAaK,KAAKH,EAAOI,OAAOH,MAClD,OAAOA,CACT,ECbII,GAAc,WCHdC,GDYJ,SAAkBN,GAChB,OAAOA,EACHA,EAAOO,MAAM,EAAGR,GAAgBC,GAAU,GAAGQ,QAAQH,GAAa,IAClEL,CACN,ECfIS,GAAWC,EACXC,GAAWC,EAMXC,GAAa,qBAGbC,GAAa,aAGbC,GAAY,cAGZC,GAAeC,aA8CnBC,GArBA,SAAkBC,GAChB,GAAoB,iBAATA,EACT,OAAOA,EAET,GAAIR,GAASQ,GACX,OA1CM,IA4CR,GAAIV,GAASU,GAAQ,CACnB,IAAIC,EAAgC,mBAAjBD,EAAME,QAAwBF,EAAME,UAAYF,EACnEA,EAAQV,GAASW,GAAUA,EAAQ,GAAMA,EAE3C,GAAoB,iBAATD,EACT,OAAiB,IAAVA,EAAcA,GAASA,EAEhCA,EAAQb,GAASa,GACjB,IAAIG,EAAWR,GAAWX,KAAKgB,GAC/B,OAAQG,GAAYP,GAAUZ,KAAKgB,GAC/BH,GAAaG,EAAMZ,MAAM,GAAIe,EAAW,EAAI,GAC3CT,GAAWV,KAAKgB,GAvDb,KAuD6BA,CACvC,EC7DII,GAAWC,GAGXC,GAAW,QCHXC,GD6BJ,SAAkBP,GAChB,OAAKA,GAGLA,EAAQI,GAASJ,MACHM,IAAYN,KAAU,IA9BpB,uBA+BFA,EAAQ,GAAK,E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,GAAoBC,eAAYC,SAAUrU,KAAKmQ,iBAC/CxQ,EAAAiB,qBAAKmF,IAAK/F,KAAKiQ,WAAY7L,UAAW8P,EAAkBI,WAAYtU,KAAKV,MAAMuF,WAC9EgB,SAAUA,EAAU+D,QAAS5J,KAAK4J,QAASsG,OAAQlQ,KAAKkQ,OAAQ/G,UAAWnJ,KAAKmJ,WAEhFxJ,EAAAiB,qBAAKwD,UAAU,mBAAmBmQ,SAAUvU,KAAKuU,UAC/CP,GAEFrU,EAAAiB,qBAAKwD,UAAU,qBACb6P,QAML,EAlgBoBtU,EAAM+H"}
|
|
1
|
+
{"version":3,"file":"toolbar-6af353fa.js","sources":["../node_modules/lodash/_trimmedEndIndex.js","../node_modules/lodash/_baseTrim.js","../node_modules/lodash/toNumber.js","../node_modules/lodash/toFinite.js","../node_modules/lodash/toInteger.js","../src/toolbar/toolbar-button-item.jsx","../assets/images/arrange_horizontally.svg","../assets/images/arrange_vertically.svg","../assets/images/notification_counter_icon.svg","../src/toolbar/toolbar-sub-utils.js","../src/toolbar/toolbar-sub-panel.jsx","../src/toolbar/toolbar-sub-menu-item.jsx","../src/toolbar/toolbar-divider-item.jsx","../src/toolbar/toolbar-sub-menu.jsx","../src/toolbar/toolbar-action-item.jsx","../src/toolbar/toolbar-overflow-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","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var toFinite = require('./toFinite');\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\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\";\n\nimport { Button } from \"carbon-components-react\";\nimport SVG from \"react-inlinesvg\";\nimport classNames from \"classnames\";\nimport { StopFilledAlt16, Play16, Undo16, Redo16, Chat16, ChatOff16, Result16,\n\tCut16, Copy16, Paste16, Edit16,\tColorPalette16, Maximize16, Minimize16,\n\tLaunch16, AddComment16, TrashCan16, ZoomIn16, ZoomOut16,\n\tChevronRight16, ChevronDown16, ChevronUp16,\n\tCenterToFit16, OpenPanelFilledLeft16 } from \"@carbon/icons-react\";\nimport { TOOLBAR_STOP, TOOLBAR_RUN, TOOLBAR_UNDO, TOOLBAR_REDO,\n\tTOOLBAR_CUT, TOOLBAR_COPY, TOOLBAR_PASTE, TOOLBAR_CLIPBOARD,\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_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 ToolbarButtonItem extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.buttonRef = React.createRef();\n\t}\n\n\tcomponentDidUpdate() {\n\t\tif (this.props.isFocusInToolbar &&\n\t\t\t\tthis.props.buttonFocusAction === this.props.actionObj.action) {\n\t\t\t// If a Jsx object was provided, the class of the component should have\n\t\t\t// been set to toolbar-jsx-obj.\n\t\t\tconst jsxItem = this.buttonRef.current.querySelector(\".toolbar-jsx-obj\");\n\t\t\tif (jsxItem) {\n\t\t\t\tjsxItem.focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.buttonRef.current.focus();\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_CLIPBOARD):\n\t\t\treturn <Result16 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\t\tcase (TOOLBAR_ZOOM_FIT):\n\t\t\treturn <CenterToFit16 disabled={disabled} />;\n\t\tcase (TOOLBAR_OPEN_PALETTE):\n\t\t\treturn <OpenPanelFilledLeft16 disabled={disabled} />;\n\t\tcase (TOOLBAR_CLOSE_PALETTE):\n\t\t\treturn <OpenPanelFilledLeft16 disabled={disabled} />;\n\t\tcase (TOOLBAR_TOGGLE_PALETTE):\n\t\t\treturn <OpenPanelFilledLeft16 disabled={disabled} />;\n\n\t\t// Non-carbon icons\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_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, isInMenu, incLabelWithIcon) {\n\t\tlet className = \"toolbar-icon-label\";\n\t\tclassName += this.generateLabelType(isInMenu, incLabelWithIcon);\n\t\tclassName += disable ? \" disabled\" : \"\";\n\t\treturn (<div className={className}>{label}</div>);\n\t}\n\n\tgenerateLabelType(isInMenu, inLabelWithIcon) {\n\t\tif (isInMenu) {\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\tgenerateRegularItem(actionObj) {\n\t\tlet labelBefore = null;\n\t\tlet labelAfter = null;\n\n\t\tif (this.props.isInMenu) {\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\t{ \"overflow\": this.props.isInMenu, \"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 = this.generateChevronIcon(actionObj);\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\t\tconst tabIndex = this.props.buttonFocusAction === actionObj.action ? 0 : -1;\n\n\t\tconst button = (\n\t\t\t<Button kind={kind}\n\t\t\t\tref={this.buttonRef}\n\t\t\t\tonClick={this.props.actionClickHandler}\n\t\t\t\tdisabled={!actionObj.enable}\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\tsize={this.props.size}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t>\n\t\t\t\t{buttonContent}\n\t\t\t</Button>\n\t\t);\n\n\t\treturn button;\n\t}\n\n\t// Returns a chevron icon if the action icon is displaying a sub-menu or\n\t// sub-panel. The chevron will:\n\t// * point right if this action item is in a drop down menu\n\t// * point down if this action item is displayed with text in the toolbar\n\t// and the menu isn't displayed\n\t// * point up if this action item is displayed with text in the toolbar\n\t// and the menu is displayed\n\t// * be a mini-chevron (small triangle in the bottom right of icon) if this\n\t// action item isn't displayed with text.\n\tgenerateChevronIcon(actionObj) {\n\t\tif (actionObj.subMenu || actionObj.subPanel) {\n\t\t\tif (this.props.isInMenu) {\n\t\t\t\treturn (<ChevronRight16 />);\n\t\t\t}\n\t\t\tif (actionObj.incLabelWithIcon === \"before\" ||\n\t\t\t\t\tactionObj.incLabelWithIcon === \"after\") {\n\t\t\t\tconst chev = this.props.subAreaDisplayed ? (<ChevronUp16 />) : (<ChevronDown16 />);\n\t\t\t\treturn (<div className={\"toolbar-up-down-chevron\"}>{chev}</div>);\n\t\t\t}\n\t\t\treturn this.generateChevronMini();\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns an svg to display the little triangle that appears in the bottom\n\t// right corner of icons that, when clicked, show a drop down menu.\n\tgenerateChevronMini() {\n\t\tconst path = this.props.size === \"sm\" ? \"M 29 29 L 29 23 23 29 Z\" : \"M 37 37 L 37 30 30 37 Z\";\n\t\treturn (\n\t\t\t<svg className=\"toolbar-tick-svg\">\n\t\t\t\t<path d={path} className=\"toolbar-tick-mark\" />\n\t\t\t</svg>\n\t\t);\n\t}\n\n\t// Creates a <div> containing the JSX in the actionObj.jsx field, wrapped in a tooltip\n\t// <div>, for display as an action item in the toolbar. The jsx field can be just\n\t// regular JSX OR a function that returns JSX. If the application has provided a\n\t// function we call it, passing in the tabIndex that the component in the JSX should\n\t// use, based on whether it is focused or not.\n\tgenerateJsxItem(actionObj) {\n\t\tlet content = null;\n\t\tif (typeof actionObj.jsx === \"function\") {\n\t\t\tconst tabIndex = this.props.buttonFocusAction === actionObj.action ? 0 : -1;\n\t\t\tcontent = actionObj.jsx(tabIndex);\n\t\t} else {\n\t\t\tcontent = actionObj.jsx;\n\t\t}\n\t\tconst jsx = this.wrapInTooltip(content);\n\t\tconst div = (<div ref={this.buttonRef}>{jsx}</div>);\n\n\t\treturn div;\n\t}\n\n\n\twrapInTooltip(content) {\n\t\tif (!this.props.isInMenu && (this.showLabelAsTip(this.props.actionObj) || this.props.actionObj.tooltip)) {\n\t\t\tconst tip = this.props.actionObj.tooltip ? this.props.actionObj.tooltip : this.props.actionObj.label;\n\t\t\tconst tooltipId = this.props.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\trender() {\n\t\tconst actionObj = this.props.actionObj;\n\n\t\tconst divContent = actionObj.jsx\n\t\t\t? this.generateJsxItem(actionObj)\n\t\t\t: this.generateRegularItem(actionObj);\n\n\t\treturn divContent;\n\t}\n}\n\nToolbarButtonItem.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\tcloseSubAreaOnClick: PropTypes.bool,\n\t\tsubMenu: PropTypes.array,\n\t\tsubPanel: PropTypes.any,\n\t\tsubPanelData: PropTypes.object,\n\t\tjsx: PropTypes.oneOfType([\n\t\t\tPropTypes.object,\n\t\t\tPropTypes.func\n\t\t]),\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\tactionName: PropTypes.string.isRequired,\n\ttooltipDirection: PropTypes.oneOf([\"top\", \"bottom\"]),\n\tinstanceId: PropTypes.number.isRequired,\n\tisInMenu: PropTypes.bool,\n\tsubAreaDisplayed: PropTypes.bool,\n\tactionClickHandler: PropTypes.func,\n\tbuttonFocusAction: PropTypes.string,\n\tisFocusInToolbar: PropTypes.bool,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"])\n};\n\nexport default ToolbarButtonItem;\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%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%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 2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\n// These utility functions are used by both toolbar-sub-menu.jsx AND\n// toolbar-sub-panel.jsx to position the sub-area (sub-menu or sub-panel)\n// relative to the parent actionItemRect, passed in, in the direction\n// indicated by the expandDirection parameter and constrained within\n// the <div> specified by the containingDivId parameter.\n\n\n// Adjust the position of the sub-area to make sure it doesn't extend\n// outside the containing divs boundary. We need to do this after the subarea\n// has been mounted so we can query its size and position.\nexport function adjustSubAreaPosition(areaRef, containingDivId, expandDirection, actionItemRect) {\n\tif (!areaRef || !actionItemRect || !containingDivId) {\n\t\treturn;\n\t}\n\tconst containingDiv = document.getElementById(containingDivId);\n\tconst containingDivRect = containingDiv\n\t\t? containingDiv.getBoundingClientRect()\n\t\t: { top: -1000, bottom: 1000, left: -1000, right: 1000 }; // To enable Jest tests.\n\n\tconst thisAreaRect = areaRef.getBoundingClientRect();\n\n\tconst outsideBottom = thisAreaRect.bottom - containingDivRect.bottom;\n\tconst outsideRight = thisAreaRect.right - containingDivRect.right;\n\n\tif (expandDirection === \"vertical\") {\n\t\tif (outsideBottom > 0) {\n\t\t\tconst topGap = actionItemRect.top - containingDivRect.top;\n\t\t\tconst newTop = (topGap > thisAreaRect.height)\n\t\t\t\t? actionItemRect.top - thisAreaRect.height\n\t\t\t\t: actionItemRect.bottom - outsideBottom;\n\n\t\t\tareaRef.style.top = newTop + \"px\";\n\t\t}\n\n\t\tif (outsideRight > 0) {\n\t\t\tconst newLeft = actionItemRect.left - outsideRight;\n\t\t\tareaRef.style.left = newLeft + \"px\";\n\t\t}\n\n\t} else {\n\t\tif (outsideBottom > 0) {\n\t\t\tconst newTop = thisAreaRect.top - outsideBottom - 2;\n\t\t\tareaRef.style.top = newTop + \"px\";\n\t\t}\n\n\t\tif (outsideRight > 0) {\n\t\t\tconst newLeft = actionItemRect.left - thisAreaRect.width;\n\t\t\tareaRef.style.left = newLeft + \"px\";\n\t\t}\n\t}\n}\n\nexport function generateSubAreaStyle(expandDirection, actionItemRect) {\n\tif (!actionItemRect) {\n\t\treturn null;\n\t}\n\n\tif (expandDirection === \"vertical\") {\n\t\treturn {\n\t\t\ttop: actionItemRect.bottom + 1,\n\t\t\tleft: actionItemRect.left\n\t\t};\n\t}\n\treturn {\n\t\ttop: actionItemRect.top - 1,\n\t\tleft: actionItemRect.left + actionItemRect.width\n\t};\n}\n\n\n","/*\n * Copyright 2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { adjustSubAreaPosition, generateSubAreaStyle } from \"./toolbar-sub-utils.js\";\n\nconst ESC_KEY = 27;\nconst LEFT_ARROW_KEY = 37;\nconst RIGHT_ARROW_KEY = 39;\n\n\nclass ToolbarSubPanel extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.closeSubPanel = this.closeSubPanel.bind(this);\n\t}\n\n\tcomponentDidMount() {\n\t\tadjustSubAreaPosition(this.areaRef,\n\t\t\tthis.props.containingDivId, this.props.expandDirection, this.props.actionItemRect);\n\t}\n\n\tcomponentDidUpdate() {\n\t\tadjustSubAreaPosition(this.areaRef,\n\t\t\tthis.props.containingDivId, this.props.expandDirection, this.props.actionItemRect);\n\t}\n\n\tonKeyDown(evt) {\n\t\tif (evt.keyCode === ESC_KEY) {\n\t\t\tthis.props.closeSubArea();\n\t\t\tevt.stopPropagation();\n\n\t\t} else if (evt.keyCode === LEFT_ARROW_KEY || evt.keyCode === RIGHT_ARROW_KEY) {\n\t\t\tevt.stopPropagation();\n\t\t}\n\t}\n\n\t// If the user clicks the panel background, by default focus would go\n\t// through to the toolbar and focus would be lost from this sub-panel.\n\t// This method prevents any focus event going through to the toolbar.\n\tonFocus(evt) {\n\t\tevt.stopPropagation();\n\t\tevt.preventDefault();\n\t}\n\n\tcloseSubPanel(evt) {\n\t\tthis.props.closeSubArea(); // Don't pass a paremeter otherwise it will check closeSubAreaOnClick.\n\t}\n\n\trender() {\n\t\tconst style = generateSubAreaStyle(this.props.expandDirection, this.props.actionItemRect);\n\n\t\tif (this.props.subPanel) {\n\t\t\treturn (\n\t\t\t\t<div ref={(ref) => (this.areaRef = ref)} style={style} className={\"toolbar-popover-list subpanel\"} tabIndex={-1}\n\t\t\t\t\tonKeyDown={this.onKeyDown} onFocus={this.onFocus}\n\t\t\t\t>\n\t\t\t\t\t<this.props.subPanel closeSubPanel={this.closeSubPanel} subPanelData={this.props.subPanelData} />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\nToolbarSubPanel.propTypes = {\n\tsubPanel: PropTypes.any.isRequired,\n\tsubPanelData: PropTypes.object,\n\tcloseSubArea: PropTypes.func,\n\tsetToolbarFocusAction: PropTypes.func,\n\tactionItemRect: PropTypes.object,\n\texpandDirection: PropTypes.string.isRequired,\n\tcontainingDivId: PropTypes.string\n};\n\nexport default ToolbarSubPanel;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport ToolbarButtonItem from \"./toolbar-button-item.jsx\";\n\nimport classNames from \"classnames\";\nimport ToolbarSubMenu from \"./toolbar-sub-menu.jsx\";\nimport ToolbarSubPanel from \"./toolbar-sub-panel.jsx\";\n\nclass ToolbarSubMenuItem extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tsubAreaDisplayed: false\n\t\t};\n\n\t\tthis.divRef = React.createRef();\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\tthis.openSubArea = this.openSubArea.bind(this);\n\t\tthis.closeSubArea = this.closeSubArea.bind(this);\n\t\tthis.clickOutside = this.clickOutside.bind(this);\n\t}\n\n\t// We must remove the eventListener in case this class is unmounted due\n\t// to the toolbar getting redrawn.\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t}\n\n\tonMouseEnter(evt) {\n\t\tif (this.props.actionObj.subMenu || this.props.actionObj.subPanel) {\n\t\t\tthis.openSubArea();\n\t\t}\n\t}\n\n\tonMouseLeave(evt) {\n\t\tif (this.props.actionObj.subMenu || this.props.actionObj.subPanel) {\n\t\t\tthis.closeSubArea();\n\t\t}\n\t}\n\n\tclickOutside(evt) {\n\t\tif (this.state.subAreaDisplayed) {\n\t\t\tconst items = document.getElementsByClassName(this.generateActionName());\n\t\t\tconst isOver = items?.length > 0 ? items[0].contains(evt.target) : false;\n\n\t\t\tif (!isOver && !this.props.actionObj.leaveSubAreaOpenOnClickOutside) {\n\t\t\t\tthis.closeSubArea();\n\t\t\t}\n\t\t}\n\t}\n\n\topenSubArea() {\n\t\tthis.setState({ subAreaDisplayed: true });\n\t}\n\n\tcloseSubArea(checkCloseSubAreaOnClick) {\n\t\tif (!checkCloseSubAreaOnClick || this.props.actionObj.closeSubAreaOnClick) {\n\t\t\tthis.setState({ subAreaDisplayed: false });\n\t\t}\n\t}\n\n\tactionClickHandler(evt) {\n\t\tif (this.props.actionObj.subMenu || this.props.actionObj.subPanel) {\n\t\t\tif (this.state.subAreaDisplayed) {\n\t\t\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t\t\t\tthis.closeSubArea();\n\t\t\t} else {\n\t\t\t\tdocument.addEventListener(\"click\", this.clickOutside, false);\n\t\t\t\tthis.openSubArea();\n\t\t\t}\n\n\t\t} else {\n\t\t\tevt.stopPropagation();\n\t\t\tif (this.props.isInCascadeMenu) {\n\t\t\t\tthis.props.closeParentSubArea(true); // true = close only if closeSubAreaOnClick is checked\n\t\t\t\tthis.props.setSubMenuFocus();\n\n\t\t\t} else if (this.props.isInOverflowMenu) {\n\t\t\t\tthis.props.setSubMenuFocus(this.props.actionObj.action);\n\n\t\t\t} else {\n\t\t\t\tthis.props.closeParentSubArea(true); // true = close only if closeSubAreaOnClick is checked\n\t\t\t\tthis.props.setToolbarFocusAction(); // Resets the toolbar focus action\n\t\t\t}\n\t\t\tthis.props.toolbarActionHandler(this.props.actionObj.action, evt);\n\t\t}\n\t}\n\n\tgenerateActionName() {\n\t\treturn this.props.actionObj.action + \"-action\";\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\tconst actionItemRect = this.divRef.current.getBoundingClientRect();\n\n\t\tif (this.props.actionObj.subPanel) {\n\t\t\treturn (\n\t\t\t\t<ToolbarSubPanel\n\t\t\t\t\tsubPanel={this.props.actionObj.subPanel}\n\t\t\t\t\tsubPanelData={this.props.actionObj.subPanelData}\n\t\t\t\t\tcloseSubArea={this.closeSubArea}\n\t\t\t\t\tactionItemRect={actionItemRect}\n\t\t\t\t\texpandDirection={\"horizontal\"}\n\t\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<ToolbarSubMenu\n\t\t\t\tsubMenuActions={this.props.actionObj.subMenu}\n\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\ttoolbarActionHandler={this.props.toolbarActionHandler}\n\t\t\t\tsetSubMenuFocus={this.props.setSubMenuFocus}\n\t\t\t\tcloseSubArea={this.closeSubArea}\n\t\t\t\tactionItemRect={actionItemRect}\n\t\t\t\texpandDirection={\"horizontal\"}\n\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\tparentSelector={this.generateSelector()}\n\t\t\t\tisCascadeMenu\n\t\t\t\tsize={this.props.size}\n\t\t\t/>\n\t\t);\n\t}\n\n\tgenerateSelector() {\n\t\treturn \".toolbar-sub-menu-item\";\n\t}\n\n\trender() {\n\t\tconst actionObj = this.props.actionObj;\n\t\tconst actionName = this.generateActionName();\n\t\tconst kindAsClass = actionObj.kind ? actionObj.kind : \"default\";\n\n\t\tconst itemClassName = classNames(\n\t\t\t{ \"toolbar-sub-menu-item\": true,\n\t\t\t\t\"toolbar-sub-menu-jsx-item\": 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.state.subAreaDisplayed ? this.generateSubArea() : null;\n\n\t\treturn (\n\t\t\t<div ref={this.divRef} className={itemClassName} data-toolbar-action={actionObj.action}\n\t\t\t\tonMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave} onKeyDown={this.onKeyDown}\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<ToolbarButtonItem\n\t\t\t\t\t\tactionObj={actionObj}\n\t\t\t\t\t\tactionName={this.generateActionName()}\n\t\t\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\t\t\tisInMenu\n\t\t\t\t\t\tsubAreaDisplayed={this.state.subAreaDisplayed}\n\t\t\t\t\t\tactionClickHandler={this.actionClickHandler}\n\t\t\t\t\t\tbuttonFocusAction={this.props.subMenuFocusAction}\n\t\t\t\t\t\tisFocusInToolbar // Focus must be in toolbar for this sub-menu item to appear\n\t\t\t\t\t\tsize={this.props.size}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{subArea}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nToolbarSubMenuItem.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\tcloseSubAreaOnClick: PropTypes.bool,\n\t\tleaveSubAreaOpenOnClickOutside: PropTypes.bool,\n\t\tsubMenu: PropTypes.array,\n\t\tsubPanel: PropTypes.any,\n\t\tsubPanelData: 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\ttoolbarActionHandler: PropTypes.func.isRequired,\n\tinstanceId: PropTypes.number.isRequired,\n\tcontainingDivId: PropTypes.string,\n\tcloseParentSubArea: PropTypes.func,\n\tsubMenuFocusAction: PropTypes.string,\n\tsetToolbarFocusAction: PropTypes.func,\n\tsetSubMenuFocus: PropTypes.func,\n\tisInOverflowMenu: PropTypes.bool,\n\tisInCascadeMenu: PropTypes.bool,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"])\n};\n\nexport default ToolbarSubMenuItem;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nclass ToolbarDividerItem extends React.Component {\n\trender() {\n\t\tconst dividerClassName = this.props.isInMenu ? \"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} tabIndex={-1} aria-hidden > </div>\n\t\t);\n\t}\n}\n\nToolbarDividerItem.propTypes = {\n\tisInMenu: PropTypes.bool\n};\n\nexport default ToolbarDividerItem;\n","/*\n * Copyright 2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport ToolbarSubMenuItem from \"./toolbar-sub-menu-item.jsx\";\nimport ToolbarDividerItem from \"./toolbar-divider-item\";\n\nimport { adjustSubAreaPosition, generateSubAreaStyle } from \"./toolbar-sub-utils.js\";\n\nconst ESC_KEY = 27;\nconst LEFT_ARROW_KEY = 37;\nconst UP_ARROW_KEY = 38;\nconst RIGHT_ARROW_KEY = 39;\nconst DOWN_ARROW_KEY = 40;\n\nclass ToolbarSubMenu extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tfocusAction: \"subarea\"\n\t\t};\n\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.setFocusAction = this.setFocusAction.bind(this);\n\t\tthis.setSubMenuFocus = this.setSubMenuFocus.bind(this);\n\t}\n\n\tcomponentDidMount() {\n\t\tif (this.props.containingDivId && this.props.subMenuActions.length > 0) {\n\t\t\tadjustSubAreaPosition(this.areaRef,\n\t\t\t\tthis.props.containingDivId, this.props.expandDirection, this.props.actionItemRect);\n\t\t}\n\n\t\tif (this.state.focusAction === \"subarea\") {\n\t\t\tthis.setFocusOnFirstItem();\n\t\t}\n\t}\n\n\tcomponentDidUpdate() {\n\t\tif (this.state.focusAction !== \"subarea\") {\n\t\t\tconst actionObj = this.props.subMenuActions.find((sma) => sma.action === this.state.focusAction);\n\t\t\tif (!actionObj?.enable) {\n\t\t\t\tconst actionToSet = this.getClosestEnabledAction(this.state.focusAction);\n\t\t\t\tif (actionToSet !== null) {\n\t\t\t\t\tthis.setFocusAction(actionToSet);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tonKeyDown(evt) {\n\t\tif (evt.keyCode === ESC_KEY) {\n\t\t\tthis.props.closeSubArea();\n\t\t\tevt.stopPropagation(); // Stop propagation in a case we are a cascade menu\n\n\t\t} else if (evt.keyCode === UP_ARROW_KEY) {\n\t\t\tthis.setFocusOnPreviousItem();\n\t\t\tevt.stopPropagation(); // Stop propagation in a case we are a cascade menu\n\n\t\t} else if (evt.keyCode === DOWN_ARROW_KEY) {\n\t\t\tthis.setFocusOnNextItem();\n\t\t\tevt.stopPropagation(); // Stop propagation in a case we are a cascade menu\n\n\t\t} else if (evt.keyCode === LEFT_ARROW_KEY) {\n\t\t\tevt.stopPropagation(); // Stop propagation in a case we are a cascade menu\n\n\t\t} else if (evt.keyCode === RIGHT_ARROW_KEY) {\n\t\t\tevt.stopPropagation(); // Stop propagation in a case we are a cascade menu\n\t\t}\n\t}\n\n\tsetFocusOnFirstItem() {\n\t\tconst focusableActions = this.getFocusableActions();\n\t\tif (focusableActions.length > 0) {\n\t\t\tthis.setFocusAction(focusableActions[0].action);\n\t\t}\n\t}\n\n\tsetFocusOnPreviousItem() {\n\t\tconst focusableActions = this.getFocusableActions();\n\t\tconst previousFocusAction = this.getPreviousFocusAction(focusableActions);\n\t\tif (previousFocusAction) {\n\t\t\tthis.setFocusAction(previousFocusAction.action);\n\t\t}\n\t}\n\n\tsetFocusOnNextItem() {\n\t\tconst focusableActions = this.getFocusableActions();\n\t\tconst nextFocusAction = this.getNextFocusAction(focusableActions);\n\t\tif (nextFocusAction) {\n\t\t\tthis.setFocusAction(nextFocusAction.action);\n\t\t}\n\t}\n\n\tsetFocusAction(focusAction) {\n\t\tthis.setState({ focusAction });\n\t}\n\n\tsetSubMenuFocus(action) {\n\t\tconst actionToSet = action || this.state.focusAction;\n\t\tthis.setFocusAction(actionToSet);\n\t}\n\n\tgetClosestEnabledAction(action) {\n\t\tconst index = this.props.subMenuActions.findIndex((sma) => sma.action === action);\n\t\tlet newAction = null;\n\t\tlet indexUp = index + 1;\n\t\tlet indexDown = index - 1;\n\n\t\twhile ((indexDown > -1 || indexUp < this.props.subMenuActions.length) && newAction === null) {\n\t\t\tif (indexDown > -1 && this.props.subMenuActions[indexDown].enable) {\n\t\t\t\tnewAction = this.props.subMenuActions[indexDown].action;\n\t\t\t} else {\n\t\t\t\tindexDown--;\n\t\t\t}\n\t\t\tif (indexUp < this.props.subMenuActions.length && this.props.subMenuActions[indexUp].enable) {\n\t\t\t\tnewAction = this.props.subMenuActions[indexUp].action;\n\t\t\t} else {\n\t\t\t\tindexUp++;\n\t\t\t}\n\t\t}\n\t\treturn newAction;\n\t}\n\n\tgetFocusableActions() {\n\t\tconst focusableActions = [];\n\n\t\tfor (let i = 0; i < this.props.subMenuActions.length; i++) {\n\t\t\tif (this.props.subMenuActions[i].enable || this.props.subMenuActions[i].jsx) {\n\t\t\t\tfocusableActions.push(this.props.subMenuActions[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn focusableActions;\n\t}\n\n\tgetPreviousFocusAction(focuableActions) {\n\t\tconst index = focuableActions.findIndex((fa) => fa.action === this.state.focusAction);\n\t\tif (index > 0) {\n\t\t\treturn focuableActions[index - 1];\n\t\t}\n\t\treturn focuableActions[focuableActions.length - 1];\n\t}\n\n\tgetNextFocusAction(focuableActions) {\n\t\tconst index = focuableActions.findIndex((fa) => fa.action === this.state.focusAction);\n\t\tif (index < focuableActions.length - 1) {\n\t\t\treturn focuableActions[index + 1];\n\t\t}\n\t\treturn focuableActions[0];\n\t}\n\n\t// Generates an array of JSX objects for a sub-menu defined by the\n\t// prop subMenuActions parameter array.\n\tgenerateSubMenuItems() {\n\t\tconst newItems = [];\n\n\t\tfor (let i = 0; i < this.props.subMenuActions.length; i++) {\n\t\t\tconst actionObj = this.props.subMenuActions[i];\n\t\t\tif (actionObj) {\n\t\t\t\tnewItems.push(this.generateSubMenuItem(actionObj, i));\n\t\t\t}\n\t\t}\n\t\treturn newItems;\n\t}\n\n\t// Returns JSX for a toolbar item based on the actionObj passed in.\n\tgenerateSubMenuItem(actionObj, i) {\n\t\tlet jsx = null;\n\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\tisInMenu\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tjsx = (\n\t\t\t\t\t<ToolbarSubMenuItem\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\ttoolbarActionHandler={this.props.toolbarActionHandler}\n\t\t\t\t\t\tcloseParentSubArea={this.props.closeSubArea}\n\t\t\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\t\t\tsubMenuFocusAction={this.state.focusAction}\n\t\t\t\t\t\tsetToolbarFocusAction={this.props.setToolbarFocusAction}\n\t\t\t\t\t\tsetSubMenuFocus={this.props.setSubMenuFocus ? this.props.setSubMenuFocus : this.setSubMenuFocus}\n\t\t\t\t\t\tsize={this.props.size}\n\t\t\t\t\t\tisInOverflowMenu={this.props.isOverflowMenu}\n\t\t\t\t\t\tisInCascadeMenu={this.props.isCascadeMenu}\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\trender() {\n\t\tif (this.props.subMenuActions.length > 0) {\n\t\t\tconst style = this.props.isCascadeMenu\n\t\t\t\t? generateSubAreaStyle(this.props.expandDirection, this.props.actionItemRect)\n\t\t\t\t: null;\n\n\t\t\tthis.subMenuItems = this.generateSubMenuItems();\n\n\t\t\treturn (\n\t\t\t\t<div ref={(ref) => (this.areaRef = ref)} style={style} className={\"toolbar-popover-list submenu\"}\n\t\t\t\t\ttabIndex={-1} onKeyDown={this.onKeyDown}\n\t\t\t\t>\n\t\t\t\t\t{this.subMenuItems}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}\n}\n\nToolbarSubMenu.propTypes = {\n\tsubMenuActions: PropTypes.array.isRequired,\n\tinstanceId: PropTypes.number.isRequired,\n\ttoolbarActionHandler: PropTypes.func,\n\tcloseSubArea: PropTypes.func,\n\tsetToolbarFocusAction: PropTypes.func,\n\tsetSubMenuFocus: PropTypes.func,\n\tactionItemRect: PropTypes.object,\n\texpandDirection: PropTypes.string.isRequired,\n\tcontainingDivId: PropTypes.string,\n\tparentSelector: PropTypes.string,\n\tisOverflowMenu: PropTypes.bool,\n\tisCascadeMenu: PropTypes.bool,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"])\n};\n\nexport default ToolbarSubMenu;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport ToolbarButtonItem from \"./toolbar-button-item.jsx\";\n\nimport classNames from \"classnames\";\nimport ToolbarSubMenu from \"./toolbar-sub-menu.jsx\";\nimport ToolbarSubPanel from \"./toolbar-sub-panel.jsx\";\n\nconst ESC_KEY = 27;\n\nclass ToolbarActionItem extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tsubAreaDisplayed: false\n\t\t};\n\n\t\tthis.divRef = React.createRef();\n\n\t\tthis.actionClickHandler = this.actionClickHandler.bind(this);\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.openSubArea = this.openSubArea.bind(this);\n\t\tthis.closeSubArea = this.closeSubArea.bind(this);\n\t\tthis.clickOutside = this.clickOutside.bind(this);\n\t}\n\n\t// We must remove the eventListener in case this class is unmounted due\n\t// to the toolbar getting redrawn.\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t}\n\n\tonKeyDown(evt) {\n\t\tif (evt.keyCode === ESC_KEY) {\n\t\t\tthis.closeSubArea();\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Called by toolbar.jsx\n\tgetBoundingRect() {\n\t\treturn this.divRef.current.getBoundingClientRect();\n\t}\n\n\t// Called by toolbar.jsx\n\tgetAction() {\n\t\treturn this.props.actionObj.action;\n\t}\n\n\t// Called by toolbar.jsx\n\tisEnabled() {\n\t\treturn this.props.actionObj.enable || this.props.actionObj.jsx;\n\t}\n\n\t// Called by toolbar.jsx and internally\n\tisSubAreaDisplayed() {\n\t\tif (this.props.actionObj.setExtIsSubAreaDisplayed &&\n\t\t\ttypeof this.props.actionObj.extIsSubAreaDisplayed !== \"undefined\") {\n\t\t\treturn this.props.actionObj.extIsSubAreaDisplayed;\n\t\t}\n\t\treturn this.state.subAreaDisplayed;\n\t}\n\n\tclickOutside(evt) {\n\t\tif (this.isSubAreaDisplayed()) {\n\t\t\tconst items = document.getElementsByClassName(this.generateActionName());\n\t\t\tconst isOver = items && items.length > 0 ? items[0].contains(evt.target) : false;\n\n\t\t\tif (!isOver && !this.props.actionObj.leaveSubAreaOpenOnClickOutside) {\n\t\t\t\tthis.closeSubArea();\n\t\t\t}\n\t\t}\n\t}\n\n\topenSubArea() {\n\t\t// If host app is controlling display of the sub-area call it to say\n\t\t// sub-area is closing.\n\t\tif (this.props.actionObj.setExtIsSubAreaDisplayed) {\n\t\t\tthis.props.actionObj.setExtIsSubAreaDisplayed(true);\n\t\t\treturn;\n\t\t}\n\t\tthis.setState({ subAreaDisplayed: true });\n\t}\n\n\tcloseSubArea(checkCloseSubAreaOnClick) {\n\t\tif (!checkCloseSubAreaOnClick || this.props.actionObj.closeSubAreaOnClick) {\n\t\t\t// If host app is controlling display of the sub-area call it to say\n\t\t\t// sub-area is closing.\n\t\t\tif (this.props.actionObj.setExtIsSubAreaDisplayed) {\n\t\t\t\tthis.props.actionObj.setExtIsSubAreaDisplayed(false);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.setState({ subAreaDisplayed: false });\n\t\t}\n\t}\n\n\tactionClickHandler(evt) {\n\t\tif (this.props.actionObj.subMenu || this.props.actionObj.subPanel) {\n\t\t\tif (this.isSubAreaDisplayed()) {\n\t\t\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t\t\t\tthis.closeSubArea();\n\t\t\t\tthis.props.setToolbarFocusAction(this.props.actionObj.action);\n\n\t\t\t} else {\n\t\t\t\tdocument.addEventListener(\"click\", this.clickOutside, false);\n\t\t\t\tthis.props.closeAnyOpenSubArea();\n\t\t\t\tthis.props.setToolbarFocusAction(this.props.actionObj.action);\n\t\t\t\tthis.openSubArea();\n\t\t\t}\n\n\t\t} else {\n\t\t\tthis.props.toolbarActionHandler(this.props.actionObj.action, evt);\n\t\t\tthis.props.setToolbarFocusAction(this.props.actionObj.action);\n\t\t}\n\t}\n\n\tgenerateActionName() {\n\t\treturn this.props.actionObj.action + \"-action\";\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\tconst actionItemRect = this.divRef.current ? this.divRef.current.getBoundingClientRect() : null;\n\n\t\tif (this.props.actionObj.subPanel) {\n\t\t\treturn (\n\t\t\t\t<ToolbarSubPanel\n\t\t\t\t\tsubPanel={this.props.actionObj.subPanel}\n\t\t\t\t\tsubPanelData={this.props.actionObj.subPanelData}\n\t\t\t\t\tcloseSubArea={this.closeSubArea}\n\t\t\t\t\tsetToolbarFocusAction={this.props.setToolbarFocusAction}\n\t\t\t\t\tactionItemRect={actionItemRect}\n\t\t\t\t\texpandDirection={\"vertical\"}\n\t\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<ToolbarSubMenu\n\t\t\t\tsubMenuActions={this.props.actionObj.subMenu}\n\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\ttoolbarActionHandler={this.props.toolbarActionHandler}\n\t\t\t\tcloseSubArea={this.closeSubArea}\n\t\t\t\tsetToolbarFocusAction={this.props.setToolbarFocusAction}\n\t\t\t\tactionItemRect={actionItemRect}\n\t\t\t\texpandDirection={\"vertical\"}\n\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\tparentSelector={this.generateSelector(this.props.actionObj)}\n\t\t\t\tisCascadeMenu={false}\n\t\t\t\tsize={this.props.size}\n\t\t\t/>\n\t\t);\n\t}\n\n\tgenerateSelector(actionObj) {\n\t\tif (actionObj.jsx) {\n\t\t\treturn \".toolbar-jsx-item\";\n\t\t}\n\t\treturn \".toolbar-item\";\n\t}\n\n\trender() {\n\t\tconst actionObj = this.props.actionObj;\n\t\tconst actionName = this.generateActionName();\n\t\tconst kindAsClass = actionObj.kind ? actionObj.kind : \"default\";\n\n\t\tconst itemClassName = classNames(\n\t\t\t{\n\t\t\t\t\"toolbar-item\": !actionObj.jsx,\n\t\t\t\t\"toolbar-jsx-item\": actionObj.jsx,\n\t\t\t\t\"toolbar-item-selected\": actionObj.isSelected\n\t\t\t},\n\t\t\tkindAsClass,\n\t\t\tactionName,\n\t\t\tthis.props.actionObj.className);\n\n\t\tconst subArea = this.isSubAreaDisplayed() ? this.generateSubArea() : null;\n\n\t\treturn (\n\t\t\t<div ref={this.divRef} className={itemClassName} data-toolbar-action={actionObj.action} data-toolbar-item\n\t\t\t\tonMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave} onKeyDown={this.onKeyDown}\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<ToolbarButtonItem\n\t\t\t\t\t\tactionObj={actionObj}\n\t\t\t\t\t\tactionName={this.generateActionName()}\n\t\t\t\t\t\ttooltipDirection={this.props.tooltipDirection}\n\t\t\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\t\t\tisInMenu={false}\n\t\t\t\t\t\tsubAreaDisplayed={this.isSubAreaDisplayed()}\n\t\t\t\t\t\tactionClickHandler={this.actionClickHandler}\n\t\t\t\t\t\tbuttonFocusAction={this.isSubAreaDisplayed() ? null : this.props.toolbarFocusAction}\n\t\t\t\t\t\tisFocusInToolbar={this.props.isFocusInToolbar}\n\t\t\t\t\t\tsize={this.props.size}\n\t\t\t\t\t/>\n\t\t\t\t</div>\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\tsetExtIsSubAreaDisplayed: PropTypes.func,\n\t\textIsSubAreaDisplayed: PropTypes.bool,\n\t\tkind: PropTypes.string,\n\t\tcloseSubAreaOnClick: PropTypes.bool,\n\t\tleaveSubAreaOpenOnClickOutside: PropTypes.bool,\n\t\tsubMenu: PropTypes.array,\n\t\tsubPanel: PropTypes.any,\n\t\tsubPanelData: PropTypes.object,\n\t\tjsx: PropTypes.oneOfType([\n\t\t\tPropTypes.object,\n\t\t\tPropTypes.func\n\t\t]),\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\tinstanceId: PropTypes.number.isRequired,\n\tcontainingDivId: PropTypes.string,\n\tcloseParentSubArea: PropTypes.func,\n\ttoolbarFocusAction: PropTypes.string,\n\tsetToolbarFocusAction: PropTypes.func,\n\tisFocusInToolbar: PropTypes.bool,\n\tcloseAnyOpenSubArea: PropTypes.func,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"])\n};\n\nexport default ToolbarActionItem;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { v4 as uuid4 } from \"uuid\";\nimport { Button } from \"carbon-components-react\";\nimport { OverflowMenuVertical16 } from \"@carbon/icons-react\";\nimport ToolbarSubMenu from \"./toolbar-sub-menu.jsx\";\n\nclass ToolbarOverflowItem extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tshowExtendedMenu: false\n\t\t};\n\n\t\tthis.buttonRef = React.createRef();\n\n\t\tthis.uuid = uuid4();\n\t\tthis.toggleExtendedMenu = this.toggleExtendedMenu.bind(this);\n\t\tthis.clickOutside = this.clickOutside.bind(this);\n\t\tthis.closeSubArea = this.closeSubArea.bind(this);\n\t}\n\n\tcomponentDidUpdate() {\n\t\tif (this.props.toolbarFocusAction === this.props.action && this.props.isFocusInToolbar && !this.state.showExtendedMenu) {\n\t\t\tthis.buttonRef.current.focus();\n\t\t}\n\t}\n\n\t// We must remove the eventListener in case this class is unmounted due\n\t// to the toolbar getting redrawn.\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t}\n\n\t// Called by toolbar.jsx\n\tgetAction() {\n\t\treturn this.props.action;\n\t}\n\n\t// Called by toolbar.jsx\n\tisSubAreaDisplayed() {\n\t\treturn this.state.showExtendedMenu;\n\t}\n\n\t// Called by toolbar.jsx and internally\n\tcloseSubArea() {\n\t\tthis.setState({ showExtendedMenu: false });\n\t}\n\n\topenSubMenu() {\n\t\tthis.setState({ showExtendedMenu: true });\n\t}\n\n\tgenOverflowButtonClassName() {\n\t\treturn \"toolbar-overflow-container \" + this.genIndexClassName() + \" \" + this.genUuidClassName();\n\t}\n\n\tgenIndexClassName() {\n\t\treturn \"toolbar-index-\" + this.props.index;\n\t}\n\n\tgenUuidClassName() {\n\t\treturn \"toolbar-uuid-\" + this.uuid;\n\t}\n\n\t// When the overflow item is clicked to open the overflow menu we must set the\n\t// index of the overflow items so the overflow menu can be correctly constructed.\n\t// The overflow index values are used to split out the overflow menu action items\n\t// from the left bar and right bar.\n\t// When the overflow menu is closed we set the overflow index values to null.\n\ttoggleExtendedMenu() {\n\t\tif (this.state.showExtendedMenu) {\n\t\t\tdocument.removeEventListener(\"click\", this.clickOutside, false);\n\t\t\tthis.props.setOverflowIndex(null); // Clear the indexes\n\t\t\tthis.closeSubArea();\n\t\t\tthis.props.setToolbarFocusAction(this.props.action); // This will not set focus on this item\n\n\t\t} else {\n\t\t\tdocument.addEventListener(\"click\", this.clickOutside, false);\n\t\t\tthis.props.closeAnyOpenSubArea();\n\t\t\tthis.props.setOverflowIndex(this.props.index);\n\t\t\tthis.openSubMenu();\n\t\t\tthis.props.setToolbarFocusAction(this.props.action);\n\t\t}\n\t}\n\n\tclickOutside(evt) {\n\t\tif (this.state.showExtendedMenu) {\n\t\t\t// Selector for the overflow-container that contains the overflow icon\n\t\t\t// and submenu (if submenu is open).\n\t\t\tconst selector = \".\" + this.genIndexClassName();\n\t\t\tconst isClickInOverflowContainer = evt.target.closest(selector);\n\t\t\tif (!isClickInOverflowContainer) {\n\t\t\t\tthis.setState({ showExtendedMenu: false });\n\t\t\t}\n\t\t}\n\t}\n\n\trender() {\n\t\tlet overflowMenu = null;\n\t\tif (this.state.showExtendedMenu) {\n\t\t\tconst actionItemRect = this.buttonRef.current.getBoundingClientRect();\n\t\t\toverflowMenu = (\n\t\t\t\t<ToolbarSubMenu\n\t\t\t\t\tref={this.subMenuRef}\n\t\t\t\t\tsubMenuActions={this.props.subMenuActions}\n\t\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\t\ttoolbarActionHandler={this.props.toolbarActionHandler}\n\t\t\t\t\tcloseSubArea={this.closeSubArea}\n\t\t\t\t\tsetToolbarFocusAction={this.props.setToolbarFocusAction}\n\t\t\t\t\tactionItemRect={actionItemRect}\n\t\t\t\t\texpandDirection={\"vertical\"}\n\t\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\t\tparentSelector={\".toolbar-overflow-container\"}\n\t\t\t\t\tisOverflowMenu\n\t\t\t\t\tisCascadeMenu={false}\n\t\t\t\t\tsize={this.props.size}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tconst tabIndex = this.props.toolbarFocusAction === this.props.action ? 0 : -1;\n\n\t\treturn (\n\t\t\t<div className={this.genOverflowButtonClassName()} data-toolbar-action={this.props.action}>\n\t\t\t\t<div className={\"toolbar-overflow-item\"}>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={this.buttonRef}\n\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\ttabIndex={tabIndex}\n\t\t\t\t\t\tonClick={this.toggleExtendedMenu}\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\tindex: PropTypes.number.isRequired,\n\taction: PropTypes.string,\n\tlabel: PropTypes.string,\n\tsize: PropTypes.oneOf([\"md\", \"sm\"]),\n\tsubMenuActions: PropTypes.array,\n\tsetOverflowIndex: PropTypes.func,\n\ttoolbarActionHandler: PropTypes.func,\n\tinstanceId: PropTypes.number.isRequired,\n\tcontainingDivId: PropTypes.string,\n\ttoolbarFocusAction: PropTypes.string,\n\tsetToolbarFocusAction: PropTypes.func,\n\tisFocusInToolbar: PropTypes.bool,\n\tcloseAnyOpenSubArea: PropTypes.func\n};\n\nexport default ToolbarOverflowItem;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\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\nconst ESC_KEY = 27;\nconst LEFT_ARROW_KEY = 37;\nconst RIGHT_ARROW_KEY = 39;\n\nclass Toolbar extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\t// this.state.focusAction keeps track of which item has focus.\n\t\t// This is used to ensure the focus goes to the same item that was\n\t\t// previously focused when focus was lost (blurred) from the toolbar\n\t\t// Index values (leftOverflowIndex and rightOverflowIndex) are used\n\t\t// to keep track of how the left and right bar arrays\n\t\t// should be split to be able to create the overflow menu.\n\t\tthis.state = {\n\t\t\tfocusAction: \"toolbar\",\n\t\t\tleftOverflowIndex: null,\n\t\t\trightOverflowIndex: null,\n\t\t};\n\n\t\t// Keeps track of whether the focus is on the toolbar or not. We should\n\t\t// not call focus() on any item in the toolbar if this.isFocusInToolbar\n\t\t// is false, otherwise focus will be moved incorrectly to the toolbar\n\t\t// and away from its current location.\n\t\tthis.isFocusInToolbar = false;\n\n\t\t// Arrays to hold the left and right bar configurations\n\t\tthis.leftBar = [];\n\t\tthis.rightBar = [];\n\n\t\t// Arrays to store references to React objects in toolbar for the\n\t\t// the left bar, right bar and current set of overflow items.\n\t\tthis.leftItemRefs = [];\n\t\tthis.rightItemRefs = [];\n\t\tthis.overflowItemRefs = [];\n\n\t\t// Reference for the toolbar <div>\n\t\tthis.toolbarRef = React.createRef();\n\n\t\tthis.onFocus = this.onFocus.bind(this);\n\t\tthis.onBlur = this.onBlur.bind(this);\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.onToolbarResize = this.onToolbarResize.bind(this);\n\t\tthis.setOverflowIndex = this.setOverflowIndex.bind(this);\n\t\tthis.generateToolbarItems = this.generateToolbarItems.bind(this);\n\t\tthis.setFocusAction = this.setFocusAction.bind(this);\n\t\tthis.setFocusOnItem = this.setFocusOnItem.bind(this);\n\t\tthis.closeAnyOpenSubArea = this.closeAnyOpenSubArea.bind(this);\n\t}\n\n\t// If, after updating, we are left in a situation where this.state.focusAction\n\t// is for an item that is NOT focusable, then set the focus on the first focusable\n\t// item. This might happen when an item with focus is activated and the action it\n\t// performs causes itself to become disabled. For example, if the delete item is\n\t// activated the selected objects are deleted and since no objects are now selected\n\t// the delete item (which has focus) will become disabled. It may also happen if the\n\t// toolbar config is updated and the current focusAction item is removed.\n\tcomponentDidUpdate() {\n\t\tconst index = this.getFocusableItemRefs().findIndex((item) => this.getRefAction(item) === this.state.focusAction);\n\t\tif (index === -1) {\n\t\t\tthis.setFocusOnFirstItem();\n\t\t}\n\t}\n\n\t// When the toolbar is initially focused, this.state.focusAction\n\t// will be set to the default of \"toolbar\". In that case we set the\n\t// focus on the first focusable toolbar item.\n\tonFocus(evt) {\n\t\tthis.isFocusInToolbar = true;\n\n\t\t// If focus occurs because of a click on the toolbar body\n\t\t// (not on a button) and no button has focus move focus to\n\t\t// the first item otherwise just keep focus the same.\n\t\tif (evt.target?.classList?.contains(\"toolbar-div\")) {\n\t\t\tif (this.state.focusAction === \"toolbar\") {\n\t\t\t\tthis.setFocusOnFirstItem();\n\n\n\t\t\t} else {\n\t\t\t\tthis.setFocusOnItem(); // Reset focus on current focusAction.\n\t\t\t}\n\t\t}\n\t}\n\n\t// When focus leaves the toolbar make sure we record it. This prevents\n\t// us accidentally setting focus on a toolbar item when the toolbar\n\t// re-renders with the focus elsewhere.\n\tonBlur(evt) {\n\t\t// If the focus is being moved to an object outside the toolbar div\n\t\t// we set isFocusInToolbar to false.\n\t\tif (!evt.relatedTarget?.closest(\".toolbar-div\")) {\n\t\t\tthis.isFocusInToolbar = false;\n\t\t}\n\t}\n\n\t// This is called when the user presses a key with focus on one of the\n\t// toolbar items. We set the focusAction appropriately based on which\n\t// key is pressed.\n\tonKeyDown(evt) {\n\t\tif (evt.keyCode === ESC_KEY) {\n\t\t\tthis.setFocusOnItem(); // Reset focus on current focusAction.\n\n\t\t} else if (evt.keyCode === LEFT_ARROW_KEY) {\n\t\t\tthis.setFocusOnPreviousItem();\n\n\t\t} else if (evt.keyCode === RIGHT_ARROW_KEY) {\n\t\t\tthis.setFocusOnNextItem();\n\t\t}\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// When the toolbar resizes, check each toolbar item to see if it has\n\t// an open sub-area and, if that item is not a focusable item, close\n\t// the sub-area. The item may no longer be focusable it is it was wrapped\n\t// into the overflow menu. Also, check to see if the current focus action\n\t// item is focusable and, if not, set focus on the first focusable item.\n\tonToolbarResize() {\n\t\tconst focusableItemRefs = this.getFocusableItemRefs();\n\t\t// Note: isFocusActionFocusable needs to be calculated here before any\n\t\t// update to the toolbar caused by the code in the subsequent if ststement.\n\t\tconst isFocusActionFocusable = this.isFocusActionFocusable(this.state.focusAction, focusableItemRefs);\n\t\tconst refWithOpenSubArea = this.getRefWithOpenSubArea();\n\n\t\tif (refWithOpenSubArea) {\n\t\t\tconst action = refWithOpenSubArea.current.getAction();\n\t\t\tconst isFocusActionWithOpenSubAreaFocusable = this.isFocusActionFocusable(action, focusableItemRefs);\n\n\t\t\tif (!isFocusActionWithOpenSubAreaFocusable) {\n\t\t\t\trefWithOpenSubArea.current.closeSubArea();\n\n\t\t\t} else {\n\t\t\t\t// This forces a refresh that will cause the position of any\n\t\t\t\t// open sub-area to be recaulculated based on the new toolbar width.\n\t\t\t\tthis.setFocusAction(this.state.focusAction);\n\t\t\t}\n\t\t}\n\n\t\t// If the focus action item is not focusable (maybe because it has been\n\t\t// moved into the overflow menu) then set focus on the first focusable item.\n\t\tif (!isFocusActionFocusable) {\n\t\t\tthis.setFocusOnFirstItem();\n\t\t}\n\t}\n\n\t// Returns the ref to any item that currently has an open sub-area or null\n\t// if no item has an open sub-area.\n\tgetRefWithOpenSubArea() {\n\t\tlet subAreaOpenRef = this.leftItemRefs.find((ref) => ref.current.isSubAreaDisplayed());\n\t\tif (!subAreaOpenRef) {\n\t\t\tsubAreaOpenRef = this.rightItemRefs.find((ref) => ref.current.isSubAreaDisplayed());\n\t\t}\n\t\tif (!subAreaOpenRef) {\n\t\t\tsubAreaOpenRef = this.overflowItemRefs.find((ref) => ref.current.isSubAreaDisplayed());\n\t\t}\n\t\treturn subAreaOpenRef;\n\t}\n\n\t// Either sets the focus on the item for the action passed in or, if\n\t// no action is passed in, set the focus on the current focusAction.\n\t// Setting the current focusAction is used to return focus back to an\n\t// item after focus has been moved elsewhere, such as onto a sub-menu\n\t// or out of the toolbar completely.\n\tsetFocusOnItem(action) {\n\t\tconst actionToSet = action || this.state.focusAction;\n\t\tconst focusableItemRefs = this.getFocusableItemRefs();\n\t\tif (focusableItemRefs.length > 0) {\n\t\t\tthis.setFocusAction(actionToSet);\n\t\t}\n\t}\n\n\tsetFocusOnFirstItem() {\n\t\tconst focusableItemRefs = this.getFocusableItemRefs();\n\t\tif (focusableItemRefs.length > 0) {\n\t\t\tconst firstFocusAction = this.getRefAction(focusableItemRefs[0]);\n\t\t\tthis.setFocusAction(firstFocusAction);\n\t\t}\n\t}\n\n\tsetFocusOnPreviousItem() {\n\t\tconst focusableItemRefs = this.getFocusableItemRefs();\n\t\tconst previousRef = this.getPreviousItemRef(focusableItemRefs);\n\t\tif (previousRef) {\n\t\t\tconst previousFocusAction = this.getRefAction(previousRef);\n\t\t\tthis.setFocusAction(previousFocusAction);\n\t\t}\n\t}\n\n\tsetFocusOnNextItem() {\n\t\tconst focusableItemRefs = this.getFocusableItemRefs();\n\t\tconst nextRef = this.getNextItemRef(focusableItemRefs);\n\t\tif (nextRef) {\n\t\t\tconst nextFocusAction = this.getRefAction(nextRef);\n\t\t\tthis.setFocusAction(nextFocusAction);\n\t\t}\n\t}\n\n\tsetFocusAction(focusAction) {\n\t\tthis.setState({ focusAction });\n\t}\n\n\tgetPreviousItemRef(focusableItemRefs) {\n\t\tconst index = focusableItemRefs.findIndex((item) => this.getRefAction(item) === this.state.focusAction);\n\t\tif (index === 0) {\n\t\t\treturn focusableItemRefs[focusableItemRefs.length - 1];\n\t\t}\n\t\treturn focusableItemRefs[index - 1];\n\t}\n\n\tgetNextItemRef(focusableItemRefs) {\n\t\tconst index = focusableItemRefs.findIndex((item) => this.getRefAction(item) === this.state.focusAction);\n\t\tif (index === focusableItemRefs.length - 1) {\n\t\t\treturn focusableItemRefs[0];\n\t\t}\n\t\treturn focusableItemRefs[index + 1];\n\t}\n\n\tgetRefAction(ref) {\n\t\treturn ref.current.getAction();\n\t}\n\n\t// Returns an array of references to focusable (that is enabled)\n\t// toolbar items that are on the top (visible) row of the toolbar.\n\tgetFocusableItemRefs() {\n\t\treturn this.getLeftBarFocusableItemRefs().concat(this.getRightBarFocusableItemRefs());\n\t}\n\n\t// Returns an array of references to left bar items that are\n\t// on the top (visible) row of the toolbar and are focusable.\n\t// That is, not disabled. In addition, there may also be a\n\t// reference to an overflow item if one is visible on the\n\t// top (visible) row of the toolbar.\n\tgetLeftBarFocusableItemRefs() {\n\t\tconst focusableItemRefs = [];\n\n\t\tif (this.leftItemRefs.length === 0) {\n\t\t\treturn focusableItemRefs;\n\t\t}\n\n\t\tconst topRowY = this.findToolbarTopYCoordinate();\n\t\tlet overflowItemRef = null;\n\n\t\tfor (let i = 0; i < this.leftItemRefs.length; i++) {\n\t\t\tconst itemRect = this.leftItemRefs[i].current.getBoundingRect();\n\n\t\t\tif (itemRect.top === topRowY) {\n\t\t\t\tif (this.leftItemRefs[i].current.isEnabled()) {\n\t\t\t\t\tfocusableItemRefs.push(this.leftItemRefs[i]);\n\t\t\t\t}\n\n\t\t\t} else if (!overflowItemRef) {\n\t\t\t\tconst leftRefAction = this.getRefAction(this.leftItemRefs[i]);\n\t\t\t\tconst overflowAction = this.getOverflowAction(leftRefAction);\n\t\t\t\toverflowItemRef = this.overflowItemRefs.find((oRef) => oRef.current.getAction() === overflowAction);\n\t\t\t\tif (overflowItemRef) {\n\t\t\t\t\tfocusableItemRefs.push(overflowItemRef);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn focusableItemRefs;\n\t}\n\n\t// Returns an array of references to right bar items that are\n\t// on the top (visible) row of the toolbar and are focusable.\n\t// That is, not disabled.\n\tgetRightBarFocusableItemRefs() {\n\t\tconst focusableItemRefs = [];\n\n\t\tif (this.rightItemRefs === 0) {\n\t\t\treturn focusableItemRefs;\n\t\t}\n\n\t\tconst topRowY = this.findToolbarTopYCoordinate();\n\n\t\tfor (let i = 0; i < this.rightItemRefs.length; i++) {\n\t\t\tif (this.rightItemRefs[i].current.isEnabled()) {\n\t\t\t\tconst refRect = this.rightItemRefs[i].current.getBoundingRect();\n\n\t\t\t\tif (refRect.top === topRowY) {\n\t\t\t\t\tfocusableItemRefs.push(this.rightItemRefs[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn focusableItemRefs.reverse();\n\t}\n\n\t// Items that appear in the overflow menu need unique action names because\n\t// the original action item to which they are related will still exist, but\n\t// hidden, in the toolbar.\n\tgetOverflowAction(action) {\n\t\treturn \"overflow_\" + action;\n\t}\n\n\t// Sets two index values: one for the left bar and one for the right that\n\t// indicate which elements in each array should be put in the overflow menu.\n\t// That is, those elements that do not appear on the top (visible) row of the\n\t// toolbar.\n\tsetOverflowIndex(leftIndex) {\n\t\tif (leftIndex === null) {\n\t\t\tthis.setState({\n\t\t\t\tleftOverflowIndex: null,\n\t\t\t\trightOverflowIndex: null\n\t\t\t});\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tleftOverflowIndex: leftIndex,\n\t\t\t\trightOverflowIndex: this.getRightOverflowIndex()\n\t\t\t});\n\t\t}\n\t}\n\n\t// Returns the index of the first item in the right bar that is\n\t// not on the top (visible) row of the toolbar.\n\tgetRightOverflowIndex() {\n\t\tconst ref = this.findFirstRightItemRefNotOnTopRow();\n\n\t\tconst index = ref === null\n\t\t\t? this.rightBar.length\n\t\t\t: this.rightBar.findIndex((ri) => ri.action === this.getRefAction(ref));\n\n\t\treturn index;\n\t}\n\n\t// Returns true of the current focus action item is one of the focusable\n\t// items. (It may not be if it has been placed in the overflow menu).\n\tisFocusActionFocusable(focusAction, focusableItemRefs) {\n\t\tconst indexFocusAction = focusableItemRefs.findIndex((ref) =>\n\t\t\tref.current.props.actionObj?.action === focusAction);\n\t\treturn indexFocusAction > -1;\n\t}\n\n\t// Returns a reference to the first item that is not on the\n\t// top (visible) row of the toolbar.\n\tfindFirstRightItemRefNotOnTopRow() {\n\t\tconst topRowY = this.findToolbarTopYCoordinate();\n\n\t\tlet rightItemRef = null;\n\n\t\tfor (let i = 0; i < this.rightItemRefs.length; i++) {\n\t\t\tconst itemRect = this.rightItemRefs[i].current.getBoundingRect();\n\t\t\tif (itemRect.top !== topRowY && rightItemRef === null) {\n\t\t\t\trightItemRef = this.rightItemRefs[i];\n\t\t\t}\n\t\t}\n\t\treturn rightItemRef;\n\t}\n\n\t// Returns the Y coordinate of the top of the toolbar. This is\n\t// used to detecg which toolbar items are on the top (visible)\n\t// row and which are wrapped onto other rows.\n\tfindToolbarTopYCoordinate() {\n\t\tconst rect = this.toolbarRef.current.getBoundingClientRect();\n\t\treturn rect.top;\n\t}\n\n\t// Generates an array of toolbar items from the toolbarActions array passed in. When\n\t// withOverflowItem is true, which it is for the left bar, we also add an overflow item,\n\t// inside an overflow item container, for each left toolbar action. As the canvas is made\n\t// narrower the regular action items wrap onto a second (hidden) row of the toolbar and\n\t// the overflow item, associated with the last wrapped action item, is revealed.\n\tgenerateToolbarItems(toolbarActions, withOverflowItem, refs) {\n\t\tconst newItems = [];\n\n\t\tfor (let i = 0; i < toolbarActions.length; i++) {\n\t\t\tconst actionObj = toolbarActions[i];\n\t\t\tif (actionObj) {\n\t\t\t\tif (!actionObj.divider && withOverflowItem) {\n\t\t\t\t\tnewItems.push(this.generateOverflowItem(i, actionObj.action));\n\t\t\t\t}\n\t\t\t\tnewItems.push(this.generateToolbarItem(actionObj, i, refs));\n\t\t\t}\n\t\t}\n\t\treturn newItems;\n\t}\n\n\t// Returns JSX for a toolbar item based on the actionObj passed in.\n\tgenerateToolbarItem(actionObj, i, refs) {\n\t\tlet jsx = null;\n\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\tisInMenu={false}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst ref = React.createRef();\n\t\t\t\tif (refs) {\n\t\t\t\t\trefs.push(ref);\n\t\t\t\t}\n\t\t\t\tjsx = (\n\t\t\t\t\t<ToolbarActionItem\n\t\t\t\t\t\tref={ref}\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\tinstanceId={this.props.instanceId}\n\t\t\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\t\t\ttoolbarFocusAction={this.state.focusAction}\n\t\t\t\t\t\tsetToolbarFocusAction={this.setFocusOnItem}\n\t\t\t\t\t\tisFocusInToolbar={this.isFocusInToolbar}\n\t\t\t\t\t\tcloseAnyOpenSubArea={this.closeAnyOpenSubArea}\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\t// Returns JSX for an overflow toolbar item based on the index and action passed in.\n\tgenerateOverflowItem(index, action) {\n\t\tconst label = this.props.additionalText ? this.props.additionalText.overflowMenuLabel : \"\";\n\t\tconst overflowAction = this.getOverflowAction(action);\n\t\tconst subMenuActions = index === this.state.leftOverflowIndex ? this.createSubMenuActions() : [];\n\n\t\t// Create a ref for the overflow item to add to array of references to\n\t\t// all overflow items.\n\t\tconst ref = React.createRef();\n\t\tthis.overflowItemRefs.push(ref);\n\n\t\tconst jsx = (\n\t\t\t<ToolbarOverflowItem\n\t\t\t\tref={ref}\n\t\t\t\tkey={\"toolbar-overflow-item-key-\" + index}\n\t\t\t\tindex={index}\n\t\t\t\taction={overflowAction}\n\t\t\t\tlabel={label}\n\t\t\t\tsize={this.props.size}\n\t\t\t\tsubMenuActions={subMenuActions}\n\t\t\t\tsetOverflowIndex={this.setOverflowIndex}\n\t\t\t\ttoolbarActionHandler={this.props.toolbarActionHandler}\n\t\t\t\tinstanceId={this.props.instanceId}\n\t\t\t\tcontainingDivId={this.props.containingDivId}\n\t\t\t\ttoolbarFocusAction={this.state.focusAction}\n\t\t\t\tsetToolbarFocusAction={this.setFocusOnItem}\n\t\t\t\tisFocusInToolbar={this.isFocusInToolbar}\n\t\t\t\tcloseAnyOpenSubArea={this.closeAnyOpenSubArea}\n\t\t\t/>\n\t\t);\n\n\t\treturn jsx;\n\t}\n\n\t// Returns an array of overflow menu actions that should be displayed in\n\t// the overflow menu for the overflow item indicated by the index passed in.\n\t// This uses this.state.leftOverflowIndex and this.state.rightOverflowIndex which are\n\t// set when the user clicks on a particular overflow item in the toolbar.\n\tcreateSubMenuActions() {\n\t\tlet subMenuActions = [];\n\t\tconst l = this.leftBar.slice(this.state.leftOverflowIndex);\n\t\tconst r = this.rightBar.slice(this.state.rightOverflowIndex).reverse();\n\t\tsubMenuActions = l.concat(r);\n\n\t\treturn subMenuActions;\n\t}\n\n\tcloseAnyOpenSubArea() {\n\t\tthis.leftItemRefs.forEach((ref) => this.closeSubAreaOnRef(ref));\n\t\tthis.rightItemRefs.forEach((ref) => this.closeSubAreaOnRef(ref));\n\t\tthis.overflowItemRefs.forEach((ref) => this.closeOverflowMenuOnRef(ref));\n\t}\n\n\tcloseSubAreaOnRef(ref) {\n\t\tif (ref.current.props.actionObj.setExtIsSubAreaDisplayed) {\n\t\t\tref.current.props.actionObj.setExtIsSubAreaDisplayed(false);\n\n\t\t} else if (ref.current.state.subAreaDisplayed) {\n\t\t\tref.current.closeSubArea();\n\t\t}\n\t}\n\n\tcloseOverflowMenuOnRef(ref) {\n\t\tif (ref.current.state.showExtendedMenu) {\n\t\t\tref.current.closeSubArea();\n\t\t}\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\t// Arrays to store references to React objects in toolbar.\n\t\tthis.leftItemRefs = [];\n\t\tthis.rightItemRefs = [];\n\t\tthis.overflowItemRefs = [];\n\n\t\tconst leftItems = this.generateToolbarItems(this.leftBar, true, this.leftItemRefs);\n\t\tconst rightItems = this.generateToolbarItems(this.rightBar, false, this.rightItemRefs);\n\n\t\tconst toolbarSizeClass = this.props.size === \"sm\" ? \"toolbar-div toolbar-size-small\" : \"toolbar-div\";\n\t\tconst tabIndex = this.state.focusAction === \"toolbar\" ? 0 : -1;\n\n\t\tconst canvasToolbar = (\n\t\t\t<ReactResizeDetector handleWidth onResize={this.onToolbarResize}>\n\t\t\t\t<div ref={this.toolbarRef} className={toolbarSizeClass} instanceid={this.props.instanceId}\n\t\t\t\t\ttabIndex={tabIndex} onFocus={this.onFocus} onBlur={this.onBlur} onKeyDown={this.onKeyDown}\n\t\t\t\t>\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.isRequired,\n\tcontainingDivId: PropTypes.string,\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","toNumber","require$$0","INFINITY","toFinite","toInteger_1","result","remainder","_React$Component","ToolbarButtonItem","props","_this","_classCallCheck","_callSuper","buttonRef","React","createRef","_inherits","_createClass","key","this","isFocusInToolbar","buttonFocusAction","actionObj","action","jsxItem","current","querySelector","focus","disabled","enable","TOOLBAR_STOP","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_CLIPBOARD","Result16","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","CenterToFit16","TOOLBAR_OPEN_PALETTE","TOOLBAR_CLOSE_PALETTE","TOOLBAR_TOGGLE_PALETTE","OpenPanelFilledLeft16","TOOLBAR_ARRANGE_HORIZONALLY","SVG","src","TOOLBAR_ARRANGE_VERTICALLY","TOOLBAR_TOGGLE_NOTIFICATION_PANEL","label","disable","isInMenu","incLabelWithIcon","className","generateLabelType","inLabelWithIcon","icon","getDefaultIcon","iconEnabled","iconDisabled","customIcon","id","instanceId","labelBefore","labelAfter","generateLabel","generateIcon","textContent","itemContentClassName","classNames","overflow","default","kind","chevronIcon","generateChevronIcon","buttonContent","wrapInTooltip","ariaLabel","tabIndex","Button","ref","onClick","actionClickHandler","size","subMenu","subPanel","ChevronRight16","chev","subAreaDisplayed","ChevronUp16","ChevronDown16","generateChevronMini","path","d","content","jsx","showLabelAsTip","tooltip","tip","tooltipId","actionName","enableTooltip","direction","tooltipDirection","Tooltip","generateJsxItem","generateRegularItem","Component","adjustSubAreaPosition","areaRef","containingDivId","expandDirection","actionItemRect","containingDiv","document","getElementById","containingDivRect","getBoundingClientRect","top","bottom","left","right","thisAreaRect","outsideBottom","outsideRight","newTop","height","style","newLeft","width","generateSubAreaStyle","ToolbarSubPanel","onKeyDown","bind","closeSubPanel","evt","keyCode","closeSubArea","stopPropagation","preventDefault","_this2","onFocus","subPanelData","ToolbarSubMenuItem","state","divRef","onMouseEnter","onMouseLeave","openSubArea","clickOutside","removeEventListener","items","getElementsByClassName","generateActionName","contains","target","leaveSubAreaOpenOnClickOutside","setState","checkCloseSubAreaOnClick","closeSubAreaOnClick","addEventListener","isInCascadeMenu","closeParentSubArea","setSubMenuFocus","isInOverflowMenu","setToolbarFocusAction","toolbarActionHandler","ToolbarSubMenu","subMenuActions","parentSelector","generateSelector","isCascadeMenu","kindAsClass","itemClassName","isSelected","subArea","generateSubArea","subMenuFocusAction","ToolbarDividerItem","arguments","dividerClassName","focusAction","setFocusAction","setFocusOnFirstItem","find","sma","actionToSet","getClosestEnabledAction","setFocusOnPreviousItem","setFocusOnNextItem","focusableActions","getFocusableActions","previousFocusAction","getPreviousFocusAction","nextFocusAction","getNextFocusAction","findIndex","newAction","indexUp","indexDown","i","push","focuableActions","_this3","fa","_this4","newItems","generateSubMenuItem","divider","isOverflowMenu","_this5","subMenuItems","generateSubMenuItems","ToolbarActionItem","setExtIsSubAreaDisplayed","extIsSubAreaDisplayed","isSubAreaDisplayed","closeAnyOpenSubArea","toolbarFocusAction","ToolbarOverflowItem","showExtendedMenu","uuid","uuid4","toggleExtendedMenu","genIndexClassName","genUuidClassName","setOverflowIndex","openSubMenu","selector","closest","overflowMenu","subMenuRef","genOverflowButtonClassName","OverflowMenuVertical16","Toolbar","leftOverflowIndex","rightOverflowIndex","leftBar","rightBar","leftItemRefs","rightItemRefs","overflowItemRefs","toolbarRef","onBlur","onToolbarResize","generateToolbarItems","setFocusOnItem","getFocusableItemRefs","item","getRefAction","_evt$target","_evt$target$classList","classList","_evt$relatedTarget","relatedTarget","currentTarget","scroll","focusableItemRefs","isFocusActionFocusable","refWithOpenSubArea","getRefWithOpenSubArea","getAction","subAreaOpenRef","firstFocusAction","previousRef","getPreviousItemRef","nextRef","getNextItemRef","getLeftBarFocusableItemRefs","concat","getRightBarFocusableItemRefs","topRowY","findToolbarTopYCoordinate","overflowItemRef","_loop","getBoundingRect","isEnabled","leftRefAction","overflowAction","getOverflowAction","oRef","reverse","leftIndex","getRightOverflowIndex","_this6","findFirstRightItemRefNotOnTopRow","ri","_ref$current$props$ac","rightItemRef","toolbarActions","withOverflowItem","refs","generateOverflowItem","generateToolbarItem","additionalText","overflowMenuLabel","createSubMenuActions","l","r","_this7","forEach","closeSubAreaOnRef","closeOverflowMenuOnRef","config","_toConsumableArray","leftItems","rightItems","toolbarSizeClass","ReactResizeDetector","handleWidth","onResize","instanceid","onScroll"],"mappings":"4pCACA,IAAIA,GAAe,SCDfC,GDWJ,SAAyBC,GAGvB,IAFA,IAAIC,EAAQD,EAAOE,OAEZD,KAAWH,GAAaK,KAAKH,EAAOI,OAAOH,MAClD,OAAOA,CACT,ECbII,GAAc,WCHdC,GDYJ,SAAkBN,GAChB,OAAOA,EACHA,EAAOO,MAAM,EAAGR,GAAgBC,GAAU,GAAGQ,QAAQH,GAAa,IAClEL,CACN,ECfIS,GAAWC,EACXC,GAAWC,EAMXC,GAAa,qBAGbC,GAAa,aAGbC,GAAY,cAGZC,GAAeC,aA8CnBC,GArBA,SAAkBC,GAChB,GAAoB,iBAATA,EACT,OAAOA,EAET,GAAIR,GAASQ,GACX,OA1CM,IA4CR,GAAIV,GAASU,GAAQ,CACnB,IAAIC,EAAgC,mBAAjBD,EAAME,QAAwBF,EAAME,UAAYF,EACnEA,EAAQV,GAASW,GAAUA,EAAQ,GAAMA,EAE3C,GAAoB,iBAATD,EACT,OAAiB,IAAVA,EAAcA,GAASA,EAEhCA,EAAQb,GAASa,GACjB,IAAIG,EAAWR,GAAWX,KAAKgB,GAC/B,OAAQG,GAAYP,GAAUZ,KAAKgB,GAC/BH,GAAaG,EAAMZ,MAAM,GAAIe,EAAW,EAAI,GAC3CT,GAAWV,KAAKgB,GAvDb,KAuD6BA,CACvC,EC7DII,GAAWC,GAGXC,GAAW,QCHXC,GD6BJ,SAAkBP,GAChB,OAAKA,GAGLA,EAAQI,GAASJ,MACHM,IAAYN,KAAU,IA9BpB,uBA+BFA,EAAQ,GAAK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