@elyra/canvas 12.41.0 → 12.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/{_baseIteratee-05ccf6a8.js → _baseIteratee-148093b7.js} +3 -3
  2. package/dist/{_baseIteratee-05ccf6a8.js.map → _baseIteratee-148093b7.js.map} +1 -1
  3. package/dist/{canvas-constants-079172c0.js → canvas-constants-acb99f64.js} +2 -2
  4. package/dist/{canvas-constants-079172c0.js.map → canvas-constants-acb99f64.js.map} +1 -1
  5. package/dist/canvas-controller-6726b9ac.js +2 -0
  6. package/dist/canvas-controller-6726b9ac.js.map +1 -0
  7. package/dist/canvas-controller-6c6bc68f.js +2 -0
  8. package/dist/canvas-controller-6c6bc68f.js.map +1 -0
  9. package/dist/common-canvas-9374ef35.js +2 -0
  10. package/dist/common-canvas-9374ef35.js.map +1 -0
  11. package/dist/common-canvas-a6435bdb.js +2 -0
  12. package/dist/common-canvas-a6435bdb.js.map +1 -0
  13. package/dist/common-canvas.es.js +1 -1
  14. package/dist/common-canvas.es.js.map +1 -1
  15. package/dist/common-canvas.js +1 -1
  16. package/dist/common-canvas.js.map +1 -1
  17. package/dist/common-properties-08707efe.js +2 -0
  18. package/dist/common-properties-08707efe.js.map +1 -0
  19. package/dist/common-properties-acd55e94.js +2 -0
  20. package/dist/common-properties-acd55e94.js.map +1 -0
  21. package/dist/context-menu-wrapper-271eb2df.js +2 -0
  22. package/dist/context-menu-wrapper-271eb2df.js.map +1 -0
  23. package/dist/context-menu-wrapper-e4a7ab4d.js +2 -0
  24. package/dist/context-menu-wrapper-e4a7ab4d.js.map +1 -0
  25. package/dist/{datarecord-metadata-v3-schema-59505bc5.js → datarecord-metadata-v3-schema-03427296.js} +2 -2
  26. package/dist/{datarecord-metadata-v3-schema-59505bc5.js.map → datarecord-metadata-v3-schema-03427296.js.map} +1 -1
  27. package/dist/{flexible-table-63ffd573.js → flexible-table-107ca2fd.js} +1 -1
  28. package/dist/{flexible-table-63ffd573.js.map → flexible-table-107ca2fd.js.map} +1 -1
  29. package/dist/{flexible-table-43e2d052.js → flexible-table-5cc1ad6b.js} +2 -2
  30. package/dist/{flexible-table-43e2d052.js.map → flexible-table-5cc1ad6b.js.map} +1 -1
  31. package/dist/{icon-0390f1fe.js → icon-2caf035c.js} +2 -2
  32. package/dist/{icon-0390f1fe.js.map → icon-2caf035c.js.map} +1 -1
  33. package/dist/{index-57503b50.js → index-5dac3da8.js} +2 -2
  34. package/dist/{index-57503b50.js.map → index-5dac3da8.js.map} +1 -1
  35. package/dist/{index-1cd54914.js → index-fee06179.js} +2 -2
  36. package/dist/{index-1cd54914.js.map → index-fee06179.js.map} +1 -1
  37. package/dist/{isArrayLikeObject-36898fcb.js → isArrayLikeObject-7a30aa4b.js} +2 -2
  38. package/dist/{isArrayLikeObject-36898fcb.js.map → isArrayLikeObject-7a30aa4b.js.map} +1 -1
  39. package/dist/lib/canvas-controller.es.js +1 -1
  40. package/dist/lib/canvas-controller.js +1 -1
  41. package/dist/lib/canvas.es.js +1 -1
  42. package/dist/lib/canvas.js +1 -1
  43. package/dist/lib/context-menu.es.js +1 -1
  44. package/dist/lib/context-menu.js +1 -1
  45. package/dist/lib/properties/clem.es.js +2 -0
  46. package/dist/lib/properties/clem.es.js.map +1 -0
  47. package/dist/lib/properties/clem.js +2 -0
  48. package/dist/lib/properties/clem.js.map +1 -0
  49. package/dist/lib/properties/field-picker.es.js +1 -1
  50. package/dist/lib/properties/field-picker.js +1 -1
  51. package/dist/lib/properties/flexible-table.es.js +1 -1
  52. package/dist/lib/properties/flexible-table.js +1 -1
  53. package/dist/lib/properties/getPythonHints.es.js +2 -0
  54. package/dist/lib/properties/getPythonHints.es.js.map +1 -0
  55. package/dist/lib/properties/getPythonHints.js +2 -0
  56. package/dist/lib/properties/getPythonHints.js.map +1 -0
  57. package/dist/lib/properties.es.js +1 -1
  58. package/dist/lib/properties.js +1 -1
  59. package/dist/lib/tooltip.es.js +1 -1
  60. package/dist/lib/tooltip.es.js.map +1 -1
  61. package/dist/lib/tooltip.js +1 -1
  62. package/dist/lib/tooltip.js.map +1 -1
  63. package/dist/styles/common-canvas.min.css +1 -1
  64. package/dist/styles/common-canvas.min.css.map +1 -1
  65. package/dist/toolbar-ccc1d600.js +2 -0
  66. package/dist/toolbar-ccc1d600.js.map +1 -0
  67. package/dist/toolbar-e4445bf8.js +2 -0
  68. package/dist/toolbar-e4445bf8.js.map +1 -0
  69. package/package.json +12 -4
  70. package/rollup.config.js +2 -0
  71. package/src/color-picker/color-picker.jsx +96 -17
  72. package/src/command-actions/arrangeLayoutAction.js +7 -6
  73. package/src/command-actions/attachNodeToLinksAction.js +4 -4
  74. package/src/command-actions/collapseSuperNodeInPlaceAction.js +5 -5
  75. package/src/command-actions/colorSelectedObjectsAction.js +4 -4
  76. package/src/command-actions/commonPropertiesAction.js +1 -1
  77. package/src/command-actions/convertSuperNodeExternalToLocalAction.js +4 -4
  78. package/src/command-actions/convertSuperNodeLocalToExternalAction.js +4 -4
  79. package/src/command-actions/createAutoNodeAction.js +14 -5
  80. package/src/command-actions/createCommentAction.js +4 -10
  81. package/src/command-actions/createCommentLinkAction.js +4 -4
  82. package/src/command-actions/createNodeAction.js +13 -4
  83. package/src/command-actions/createNodeAttachLinksAction.js +4 -4
  84. package/src/command-actions/createNodeLinkAction.js +13 -4
  85. package/src/command-actions/createNodeLinkDetachedAction.js +4 -4
  86. package/src/command-actions/createNodeOnLinkAction.js +4 -4
  87. package/src/command-actions/createSuperNodeAction.js +7 -7
  88. package/src/command-actions/deconstructSuperNodeAction.js +5 -5
  89. package/src/command-actions/deleteLinkAction.js +4 -4
  90. package/src/command-actions/deleteObjectsAction.js +15 -6
  91. package/src/command-actions/disconnectObjectsAction.js +13 -4
  92. package/src/command-actions/displayPreviousPipelineAction.js +4 -4
  93. package/src/command-actions/displaySubPipelineAction.js +4 -4
  94. package/src/command-actions/editCommentAction.js +4 -4
  95. package/src/command-actions/editDecorationLabelAction.js +4 -4
  96. package/src/command-actions/expandSuperNodeInPlaceAction.js +5 -5
  97. package/src/command-actions/insertNodeIntoLinkAction.js +4 -4
  98. package/src/command-actions/moveObjectsAction.js +4 -4
  99. package/src/command-actions/pasteAction.js +16 -7
  100. package/src/command-actions/saveToPaletteAction.js +4 -4
  101. package/src/command-actions/setLinksStyleAction.js +4 -4
  102. package/src/command-actions/setNodeLabelAction.js +4 -4
  103. package/src/command-actions/setObjectsStyleAction.js +4 -4
  104. package/src/command-actions/sizeAndPositionObjectsAction.js +4 -4
  105. package/src/command-actions/updateLinkAction.js +4 -4
  106. package/src/common-canvas/canvas-controller-menu-utils.js +1 -1
  107. package/src/common-canvas/canvas-controller.js +116 -62
  108. package/src/common-canvas/cc-central-items.jsx +1 -5
  109. package/src/common-canvas/cc-context-toolbar.jsx +9 -13
  110. package/src/common-canvas/cc-toolbar.jsx +28 -9
  111. package/src/common-canvas/common-canvas.scss +3 -3
  112. package/src/common-canvas/svg-canvas-d3.scss +3 -2
  113. package/src/common-canvas/svg-canvas-renderer.js +50 -23
  114. package/src/common-canvas/svg-canvas-utils-drag-det-link.js +8 -1
  115. package/src/common-canvas/svg-canvas-utils-drag-new-link.js +1 -1
  116. package/src/common-properties/components/field-picker/field-picker.jsx +4 -0
  117. package/src/common-properties/components/table-buttons/table-buttons.scss +0 -1
  118. package/src/common-properties/controls/checkbox/checkbox.scss +0 -1
  119. package/src/common-properties/controls/expression/expression-builder/expression-builder.jsx +32 -26
  120. package/src/common-properties/controls/expression/expression.jsx +143 -116
  121. package/src/common-properties/controls/expression/expression.scss +43 -45
  122. package/src/common-properties/controls/expression/languages/CLEM-hint.js +86 -159
  123. package/src/common-properties/controls/expression/languages/python-hint.js +41 -104
  124. package/src/common-properties/controls/expression/languages/r-hint.js +61 -128
  125. package/src/common-properties/index.js +4 -2
  126. package/src/common-properties/properties-controller.js +5 -0
  127. package/src/context-menu/common-context-menu.jsx +4 -1
  128. package/src/index.js +14 -4
  129. package/src/notification-panel/notification-panel.jsx +82 -56
  130. package/src/notification-panel/notification-panel.scss +42 -40
  131. package/src/object-model/object-model.js +19 -5
  132. package/src/object-model/redux/canvas-store.js +4 -3
  133. package/src/object-model/redux/reducers/canvasinfo.js +7 -11
  134. package/src/object-model/redux/reducers/canvastoolbar.js +5 -6
  135. package/src/palette/palette-dialog-topbar.jsx +27 -38
  136. package/src/palette/palette-flyout-content-category.jsx +25 -6
  137. package/src/palette/palette.scss +8 -40
  138. package/src/toolbar/{toolbar-utils.js → index.js} +3 -18
  139. package/src/toolbar/toolbar-action-item.jsx +122 -316
  140. package/src/toolbar/toolbar-button-item.jsx +381 -0
  141. package/src/toolbar/toolbar-divider-item.jsx +4 -5
  142. package/src/toolbar/toolbar-overflow-item.jsx +85 -37
  143. package/src/toolbar/toolbar-sub-menu-item.jsx +236 -0
  144. package/src/toolbar/toolbar-sub-menu.jsx +252 -0
  145. package/src/toolbar/toolbar-sub-panel.jsx +94 -0
  146. package/src/toolbar/toolbar-sub-utils.js +86 -0
  147. package/src/toolbar/toolbar.jsx +386 -148
  148. package/src/toolbar/toolbar.scss +63 -56
  149. package/src/tooltip/tooltip.jsx +65 -12
  150. package/stats.html +1 -1
  151. package/assets/images/palette/close_32.svg +0 -1
  152. package/assets/images/palette/palette_close.svg +0 -4
  153. package/assets/images/palette/palette_grid_deselected.svg +0 -2
  154. package/assets/images/palette/palette_grid_hover.svg +0 -2
  155. package/assets/images/palette/palette_grid_selected.svg +0 -2
  156. package/assets/images/palette/palette_list_deselected.svg +0 -1
  157. package/assets/images/palette/palette_list_hover.svg +0 -1
  158. package/assets/images/palette/palette_list_selected.svg +0 -1
  159. package/assets/images/palette/palette_open.svg +0 -4
  160. package/assets/images/zoom_to_fit.svg +0 -8
  161. package/dist/canvas-controller-1e71b405.js +0 -2
  162. package/dist/canvas-controller-1e71b405.js.map +0 -1
  163. package/dist/canvas-controller-4bed5320.js +0 -2
  164. package/dist/canvas-controller-4bed5320.js.map +0 -1
  165. package/dist/common-canvas-097c5169.js +0 -2
  166. package/dist/common-canvas-097c5169.js.map +0 -1
  167. package/dist/common-canvas-e13c0858.js +0 -2
  168. package/dist/common-canvas-e13c0858.js.map +0 -1
  169. package/dist/common-properties-706cef87.js +0 -2
  170. package/dist/common-properties-706cef87.js.map +0 -1
  171. package/dist/common-properties-9bd69b61.js +0 -2
  172. package/dist/common-properties-9bd69b61.js.map +0 -1
  173. package/dist/context-menu-wrapper-3a7fdec8.js +0 -2
  174. package/dist/context-menu-wrapper-3a7fdec8.js.map +0 -1
  175. package/dist/context-menu-wrapper-fc85d853.js +0 -2
  176. package/dist/context-menu-wrapper-fc85d853.js.map +0 -1
  177. package/dist/toolbar-918ab52e.js +0 -2
  178. package/dist/toolbar-918ab52e.js.map +0 -1
  179. package/dist/toolbar-fdb750f9.js +0 -2
  180. package/dist/toolbar-fdb750f9.js.map +0 -1
  181. package/src/palette/palette-dialog-topbar-three-way-icon.jsx +0 -82
  182. package/src/toolbar/toolbar-action-sub-area.jsx +0 -126
  183. package/src/toolbar/toolbar-overflow-menu.jsx +0 -77
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017-2023 Elyra Authors
2
+ * Copyright 2017-2024 Elyra Authors
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -30,13 +30,18 @@ $toolbar-divider-width: 1px;
30
30
  background-color: $ui-01;
31
31
  box-sizing: content-box;
32
32
  position: relative;
33
-
34
33
  display: flex;
35
34
  justify-content: space-between;
35
+ outline: none; // Turn outline off and use carbon style for focus below.
36
36
 
37
37
  /* Prevent elements from being dragged onto canvas */
38
38
  -webkit-user-drag: none;
39
39
 
40
+ &:focus {
41
+ border-color: $interactive-03;
42
+ box-shadow: inset 0 0 0 2px $interactive-03;
43
+ }
44
+
40
45
  /* Small size toolbar */
41
46
  &.toolbar-size-small {
42
47
  height: $toolbar-button-sm-height;
@@ -51,7 +56,7 @@ $toolbar-divider-width: 1px;
51
56
  height: $toolbar-button-sm-height;
52
57
  }
53
58
 
54
- .toolbar-overflow-menu-item {
59
+ .toolbar-sub-menu-item {
55
60
  height: fit-content;
56
61
  }
57
62
 
@@ -66,10 +71,6 @@ $toolbar-divider-width: 1px;
66
71
  padding: 0;
67
72
  }
68
73
 
69
- .toolbar-popover-list {
70
- top: calc(#{$toolbar-button-sm-height} + #{$toolbar-divider-width} - 1px);
71
- }
72
-
73
74
  .toolbar-jsx-item {
74
75
  height: $toolbar-button-sm-height;
75
76
  }
@@ -105,6 +106,7 @@ $toolbar-divider-width: 1px;
105
106
  & button {
106
107
  padding: 0;
107
108
  min-height: 30px;
109
+ height: $toolbar-button-height;
108
110
  }
109
111
 
110
112
  &.default,
@@ -144,7 +146,7 @@ $toolbar-divider-width: 1px;
144
146
  }
145
147
  }
146
148
 
147
- .toolbar-spacer {
149
+ .toolbar-overflow-container {
148
150
  width: 0;
149
151
  display: inline-block;
150
152
  }
@@ -171,7 +173,7 @@ $toolbar-divider-width: 1px;
171
173
  }
172
174
  }
173
175
 
174
- .toolbar-overflow-menu-item {
176
+ .toolbar-sub-menu-item {
175
177
  & button {
176
178
  width: 100%;
177
179
  padding-top: 0;
@@ -200,10 +202,15 @@ $toolbar-divider-width: 1px;
200
202
  &.disabled.default {
201
203
  color: $disabled-02;
202
204
  fill: $disabled-02; // For custom svg images
205
+ & .toolbar-tick-mark {
206
+ fill: $disabled-02;
207
+ }
208
+ & .toolbar-text-content {
209
+ stroke: $disabled-02;
210
+ }
203
211
  }
204
212
 
205
213
  .toolbar-icon {
206
- height: $toolbar-icon-size;
207
214
  & svg {
208
215
  height: $toolbar-icon-size;
209
216
  width: $toolbar-icon-size;
@@ -211,52 +218,52 @@ $toolbar-divider-width: 1px;
211
218
  -webkit-user-drag: none;
212
219
  }
213
220
  }
214
- }
215
221
 
216
- .toolbar-text-content {
217
- position: absolute;
218
- top: 14px;
219
- font-size: 9px;
220
- line-height: 9px;
221
- color: $icon-01;
222
- }
222
+ .toolbar-text-content {
223
+ position: absolute;
224
+ top: 14px;
225
+ font-size: 9px;
226
+ line-height: 9px;
227
+ color: $icon-01;
228
+ }
223
229
 
224
- .toolbar-icon-label {
225
- line-height: 16px;
230
+ .toolbar-icon-label {
231
+ line-height: 16px;
226
232
 
227
- &.before {
228
- padding-right: 8px;
229
- }
233
+ &.before {
234
+ padding-right: 8px;
235
+ }
230
236
 
231
- &.after {
232
- padding-left: 8px;
237
+ &.after {
238
+ padding-left: 8px;
239
+ }
240
+
241
+ &.overflow {
242
+ padding-left: 8px;
243
+ word-break: break-word;
244
+ hyphens: auto;
245
+ }
233
246
  }
234
247
 
235
- &.overflow {
248
+ .toolbar-up-down-chevron {
236
249
  padding-left: 8px;
237
- word-break: break-word;
238
- hyphens: auto;
250
+ height: 16px;
251
+ pointer-events: none;
239
252
  }
240
- }
241
253
 
242
- .toolbar-up-down-chevron {
243
- padding-left: 8px;
244
- height: 16px;
245
- pointer-events: none;
246
- }
247
-
248
- // Triangular tick mark in bottom right corner of an expandable icon
249
- .toolbar-tick-svg {
250
- position: absolute;
251
- bottom: 0;
252
- right: 0;
253
- height: $toolbar-button-height;
254
- width: $toolbar-button-height;
255
- pointer-events: none;
256
- }
254
+ // Triangular tick mark in bottom right corner of an expandable icon
255
+ .toolbar-tick-svg {
256
+ position: absolute;
257
+ bottom: 0;
258
+ right: 0;
259
+ height: $toolbar-button-height;
260
+ width: $toolbar-button-height;
261
+ pointer-events: none;
257
262
 
258
- .toolbar-tick-mark {
259
- fill: $interactive-02;
263
+ & .toolbar-tick-mark {
264
+ fill: $icon-01;
265
+ }
266
+ }
260
267
  }
261
268
 
262
269
  .toolbar-jsx-item {
@@ -269,7 +276,7 @@ $toolbar-divider-width: 1px;
269
276
  padding: 0;
270
277
  }
271
278
 
272
- .toolbar-overflow-jsx-item {
279
+ .toolbar-sub-menu-jsx-item {
273
280
  width: 100%;
274
281
  height: 38px;
275
282
  display: inline-flex;
@@ -284,8 +291,6 @@ $toolbar-divider-width: 1px;
284
291
  &.ghost {
285
292
  & button {
286
293
  background-color: $ui-03;
287
- border-color: transparent;
288
- box-shadow: none;
289
294
  border-bottom: 2px solid $interactive-01;
290
295
  }
291
296
  }
@@ -306,24 +311,26 @@ $toolbar-divider-width: 1px;
306
311
 
307
312
  .toolbar-popover-list {
308
313
  width: 200px;
309
- z-index: 1;
310
- top: calc(#{$toolbar-button-height} + #{$toolbar-divider-width});
314
+ z-index: 2; // Make sure sub-area appears above bottom panel
311
315
  display: block;
312
- position: absolute;
316
+ position: fixed; // Actual position will be calculated in the code
313
317
  list-style-type: none;
314
318
  padding: 0;
315
319
  border: $toolbar-divider-width solid $ui-03;
316
320
  background-color: $ui-01;
321
+ opacity: 0;
322
+ animation: tovisible 0.25s ease-in-out forwards; // Use keyframe to animate panel visibility
317
323
 
318
324
  &.submenu {
319
- // Position will be calculated in the code
320
- position: fixed;
321
325
  min-width: 100px;
322
326
  }
323
327
 
324
328
  &.subpanel {
325
- // Position will be calculated in the code
326
- position: fixed;
327
329
  width: fit-content;
328
330
  }
329
331
  }
332
+
333
+ @keyframes tovisible {
334
+ 100% { opacity: 1; }
335
+ }
336
+
@@ -79,6 +79,13 @@ class ToolTip extends React.Component {
79
79
  if (tooltipTrigger && tooltip) {
80
80
  this.updateTooltipLayout(tooltip, tooltipTrigger, tooltip.getAttribute("direction"));
81
81
  }
82
+
83
+ const linkElement = this.targetRef.querySelector("a");
84
+
85
+ // Focus on link when tooltip with link is opened
86
+ if (linkElement) {
87
+ linkElement.focus();
88
+ }
82
89
  }
83
90
  }
84
91
  }
@@ -87,6 +94,10 @@ class ToolTip extends React.Component {
87
94
  if (evt.key === "Tab") {
88
95
  this.tabKeyPressed = true;
89
96
  }
97
+ if (evt.key === "Escape") {
98
+ this.triggerRef.focus();
99
+ this.setTooltipVisible(false);
100
+ }
90
101
  }
91
102
 
92
103
  getStyleValue(value) {
@@ -320,6 +331,9 @@ class ToolTip extends React.Component {
320
331
  // To prevent this default behavior, stopPropagation and preventDefault is used.
321
332
  evt.stopPropagation();
322
333
  evt.preventDefault();
334
+
335
+ // When tooltip with link is closed and another tooltip is opened newly opened tooltip should have focus.
336
+ this.triggerRef.focus();
323
337
  if (this.state.isTooltipVisible) {
324
338
  // Tooltip is visible and user clicks on trigger element again, hide tooltip
325
339
  this.setTooltipVisible(false);
@@ -351,8 +365,15 @@ class ToolTip extends React.Component {
351
365
  if (this.tabKeyPressed) {
352
366
  this.setTooltipVisible(false);
353
367
  this.tabKeyPressed = false;
354
- } else if (evt.relatedTarget === null) { // Keep tooltip visible when clicked on a link.
355
- this.setTooltipVisible(false);
368
+ } else {
369
+ // Check if evt.relatedTarget is a child of .common-canvas-tooltip to set tooltip visible when clicked on link
370
+ const el = evt?.relatedTarget?.closest(".common-canvas-tooltip");
371
+ if (el?.tagName?.toLowerCase() === "div") {
372
+ this.setTooltipVisible(true);
373
+ } else {
374
+ // Close the tooltip if evt.relatedTarget is not a child of .common-canvas-tooltip
375
+ this.setTooltipVisible(false);
376
+ }
356
377
  }
357
378
  };
358
379
  const click = (evt) => this.toggleTooltipOnClick(evt);
@@ -398,22 +419,53 @@ class ToolTip extends React.Component {
398
419
  if (this.props.className) {
399
420
  tipClass += " " + this.props.className;
400
421
  }
401
-
422
+ let linkClicked = false;
402
423
  let link = null;
403
424
  if (this.state.isTooltipVisible && this.props.tooltipLinkHandler && this.props.link) {
404
425
  const linkInformation = this.props.tooltipLinkHandler(this.props.link);
405
426
  // Verify tooltipLinkHandler returns object in correct format
406
427
  if (typeof linkInformation === "object" && linkInformation.label && linkInformation.url) {
407
- link = (<Link
408
- className="tooltip-link"
409
- id={this.props.link.id}
410
- href={linkInformation.url}
411
- target="_blank"
412
- rel="noopener"
413
- visited={false}
428
+ link = (<div
429
+ ref={(ref) => (this.linkRef = ref)}
430
+ onKeyDown={(evt) => {
431
+ evt.stopPropagation();
432
+ evt.preventDefault();
433
+
434
+ // When 'Esc' is pressed shift the focus to tooltip icon so that user can navigate following elements.
435
+ if (evt.key === "Escape") {
436
+ this.triggerRef.focus();
437
+ this.setTooltipVisible(false);
438
+ } else if (evt.key === "Enter") { // Open active/highlighted link when Enter or Return is clicked.
439
+ const focusedElement = this.linkRef.children[0];
440
+ if (focusedElement) {
441
+ window.open(focusedElement, "_blank");
442
+ }
443
+ }
444
+ }}
445
+ onBlur={() => {
446
+ if (linkClicked) { // Keep tooltip open when link is clicked
447
+ this.setTooltipVisible(true);
448
+ } else { // Close the tooltip and shift focus to tooltip icon
449
+ this.triggerRef.focus();
450
+ this.setTooltipVisible(false);
451
+ }
452
+ }
453
+ }
454
+ onClick={() => {
455
+ linkClicked = true;
456
+ }}
414
457
  >
415
- {linkInformation.label}
416
- </Link>);
458
+ <Link
459
+ className="tooltip-link"
460
+ id={this.props.link.id}
461
+ href={linkInformation.url}
462
+ target="_blank"
463
+ rel="noopener"
464
+ visited={false}
465
+ >
466
+ {linkInformation.label}
467
+ </Link>
468
+ </div>);
417
469
  }
418
470
  }
419
471
 
@@ -428,6 +480,7 @@ class ToolTip extends React.Component {
428
480
  className={tipClass}
429
481
  aria-hidden={!this.state.isTooltipVisible}
430
482
  direction={this.props.direction}
483
+ ref={(ref) => (this.targetRef = ref)}
431
484
  >
432
485
  <svg className="tipArrow" x="0px" y="0px" viewBox="0 0 9.1 16.1">
433
486
  <polyline points="9.1,15.7 1.4,8.1 9.1,0.5" />