@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.
- package/dist/{_baseIteratee-05ccf6a8.js → _baseIteratee-148093b7.js} +3 -3
- package/dist/{_baseIteratee-05ccf6a8.js.map → _baseIteratee-148093b7.js.map} +1 -1
- package/dist/{canvas-constants-079172c0.js → canvas-constants-acb99f64.js} +2 -2
- package/dist/{canvas-constants-079172c0.js.map → canvas-constants-acb99f64.js.map} +1 -1
- package/dist/canvas-controller-6726b9ac.js +2 -0
- package/dist/canvas-controller-6726b9ac.js.map +1 -0
- package/dist/canvas-controller-6c6bc68f.js +2 -0
- package/dist/canvas-controller-6c6bc68f.js.map +1 -0
- package/dist/common-canvas-9374ef35.js +2 -0
- package/dist/common-canvas-9374ef35.js.map +1 -0
- package/dist/common-canvas-a6435bdb.js +2 -0
- package/dist/common-canvas-a6435bdb.js.map +1 -0
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.es.js.map +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/common-canvas.js.map +1 -1
- package/dist/common-properties-08707efe.js +2 -0
- package/dist/common-properties-08707efe.js.map +1 -0
- package/dist/common-properties-acd55e94.js +2 -0
- package/dist/common-properties-acd55e94.js.map +1 -0
- package/dist/context-menu-wrapper-271eb2df.js +2 -0
- package/dist/context-menu-wrapper-271eb2df.js.map +1 -0
- package/dist/context-menu-wrapper-e4a7ab4d.js +2 -0
- package/dist/context-menu-wrapper-e4a7ab4d.js.map +1 -0
- package/dist/{datarecord-metadata-v3-schema-59505bc5.js → datarecord-metadata-v3-schema-03427296.js} +2 -2
- package/dist/{datarecord-metadata-v3-schema-59505bc5.js.map → datarecord-metadata-v3-schema-03427296.js.map} +1 -1
- package/dist/{flexible-table-63ffd573.js → flexible-table-107ca2fd.js} +1 -1
- package/dist/{flexible-table-63ffd573.js.map → flexible-table-107ca2fd.js.map} +1 -1
- package/dist/{flexible-table-43e2d052.js → flexible-table-5cc1ad6b.js} +2 -2
- package/dist/{flexible-table-43e2d052.js.map → flexible-table-5cc1ad6b.js.map} +1 -1
- package/dist/{icon-0390f1fe.js → icon-2caf035c.js} +2 -2
- package/dist/{icon-0390f1fe.js.map → icon-2caf035c.js.map} +1 -1
- package/dist/{index-57503b50.js → index-5dac3da8.js} +2 -2
- package/dist/{index-57503b50.js.map → index-5dac3da8.js.map} +1 -1
- package/dist/{index-1cd54914.js → index-fee06179.js} +2 -2
- package/dist/{index-1cd54914.js.map → index-fee06179.js.map} +1 -1
- package/dist/{isArrayLikeObject-36898fcb.js → isArrayLikeObject-7a30aa4b.js} +2 -2
- package/dist/{isArrayLikeObject-36898fcb.js.map → isArrayLikeObject-7a30aa4b.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/context-menu.es.js +1 -1
- package/dist/lib/context-menu.js +1 -1
- package/dist/lib/properties/clem.es.js +2 -0
- package/dist/lib/properties/clem.es.js.map +1 -0
- package/dist/lib/properties/clem.js +2 -0
- package/dist/lib/properties/clem.js.map +1 -0
- package/dist/lib/properties/field-picker.es.js +1 -1
- package/dist/lib/properties/field-picker.js +1 -1
- package/dist/lib/properties/flexible-table.es.js +1 -1
- package/dist/lib/properties/flexible-table.js +1 -1
- package/dist/lib/properties/getPythonHints.es.js +2 -0
- package/dist/lib/properties/getPythonHints.es.js.map +1 -0
- package/dist/lib/properties/getPythonHints.js +2 -0
- package/dist/lib/properties/getPythonHints.js.map +1 -0
- package/dist/lib/properties.es.js +1 -1
- package/dist/lib/properties.js +1 -1
- package/dist/lib/tooltip.es.js +1 -1
- package/dist/lib/tooltip.es.js.map +1 -1
- package/dist/lib/tooltip.js +1 -1
- package/dist/lib/tooltip.js.map +1 -1
- package/dist/styles/common-canvas.min.css +1 -1
- package/dist/styles/common-canvas.min.css.map +1 -1
- package/dist/toolbar-ccc1d600.js +2 -0
- package/dist/toolbar-ccc1d600.js.map +1 -0
- package/dist/toolbar-e4445bf8.js +2 -0
- package/dist/toolbar-e4445bf8.js.map +1 -0
- package/package.json +12 -4
- package/rollup.config.js +2 -0
- package/src/color-picker/color-picker.jsx +96 -17
- package/src/command-actions/arrangeLayoutAction.js +7 -6
- package/src/command-actions/attachNodeToLinksAction.js +4 -4
- package/src/command-actions/collapseSuperNodeInPlaceAction.js +5 -5
- package/src/command-actions/colorSelectedObjectsAction.js +4 -4
- package/src/command-actions/commonPropertiesAction.js +1 -1
- package/src/command-actions/convertSuperNodeExternalToLocalAction.js +4 -4
- package/src/command-actions/convertSuperNodeLocalToExternalAction.js +4 -4
- package/src/command-actions/createAutoNodeAction.js +14 -5
- package/src/command-actions/createCommentAction.js +4 -10
- package/src/command-actions/createCommentLinkAction.js +4 -4
- package/src/command-actions/createNodeAction.js +13 -4
- package/src/command-actions/createNodeAttachLinksAction.js +4 -4
- package/src/command-actions/createNodeLinkAction.js +13 -4
- package/src/command-actions/createNodeLinkDetachedAction.js +4 -4
- package/src/command-actions/createNodeOnLinkAction.js +4 -4
- package/src/command-actions/createSuperNodeAction.js +7 -7
- package/src/command-actions/deconstructSuperNodeAction.js +5 -5
- package/src/command-actions/deleteLinkAction.js +4 -4
- package/src/command-actions/deleteObjectsAction.js +15 -6
- package/src/command-actions/disconnectObjectsAction.js +13 -4
- package/src/command-actions/displayPreviousPipelineAction.js +4 -4
- package/src/command-actions/displaySubPipelineAction.js +4 -4
- package/src/command-actions/editCommentAction.js +4 -4
- package/src/command-actions/editDecorationLabelAction.js +4 -4
- package/src/command-actions/expandSuperNodeInPlaceAction.js +5 -5
- package/src/command-actions/insertNodeIntoLinkAction.js +4 -4
- package/src/command-actions/moveObjectsAction.js +4 -4
- package/src/command-actions/pasteAction.js +16 -7
- package/src/command-actions/saveToPaletteAction.js +4 -4
- package/src/command-actions/setLinksStyleAction.js +4 -4
- package/src/command-actions/setNodeLabelAction.js +4 -4
- package/src/command-actions/setObjectsStyleAction.js +4 -4
- package/src/command-actions/sizeAndPositionObjectsAction.js +4 -4
- package/src/command-actions/updateLinkAction.js +4 -4
- package/src/common-canvas/canvas-controller-menu-utils.js +1 -1
- package/src/common-canvas/canvas-controller.js +116 -62
- package/src/common-canvas/cc-central-items.jsx +1 -5
- package/src/common-canvas/cc-context-toolbar.jsx +9 -13
- package/src/common-canvas/cc-toolbar.jsx +28 -9
- package/src/common-canvas/common-canvas.scss +3 -3
- package/src/common-canvas/svg-canvas-d3.scss +3 -2
- package/src/common-canvas/svg-canvas-renderer.js +50 -23
- package/src/common-canvas/svg-canvas-utils-drag-det-link.js +8 -1
- package/src/common-canvas/svg-canvas-utils-drag-new-link.js +1 -1
- package/src/common-properties/components/field-picker/field-picker.jsx +4 -0
- package/src/common-properties/components/table-buttons/table-buttons.scss +0 -1
- package/src/common-properties/controls/checkbox/checkbox.scss +0 -1
- package/src/common-properties/controls/expression/expression-builder/expression-builder.jsx +32 -26
- package/src/common-properties/controls/expression/expression.jsx +143 -116
- package/src/common-properties/controls/expression/expression.scss +43 -45
- package/src/common-properties/controls/expression/languages/CLEM-hint.js +86 -159
- package/src/common-properties/controls/expression/languages/python-hint.js +41 -104
- package/src/common-properties/controls/expression/languages/r-hint.js +61 -128
- package/src/common-properties/index.js +4 -2
- package/src/common-properties/properties-controller.js +5 -0
- package/src/context-menu/common-context-menu.jsx +4 -1
- package/src/index.js +14 -4
- package/src/notification-panel/notification-panel.jsx +82 -56
- package/src/notification-panel/notification-panel.scss +42 -40
- package/src/object-model/object-model.js +19 -5
- package/src/object-model/redux/canvas-store.js +4 -3
- package/src/object-model/redux/reducers/canvasinfo.js +7 -11
- package/src/object-model/redux/reducers/canvastoolbar.js +5 -6
- package/src/palette/palette-dialog-topbar.jsx +27 -38
- package/src/palette/palette-flyout-content-category.jsx +25 -6
- package/src/palette/palette.scss +8 -40
- package/src/toolbar/{toolbar-utils.js → index.js} +3 -18
- package/src/toolbar/toolbar-action-item.jsx +122 -316
- package/src/toolbar/toolbar-button-item.jsx +381 -0
- package/src/toolbar/toolbar-divider-item.jsx +4 -5
- package/src/toolbar/toolbar-overflow-item.jsx +85 -37
- package/src/toolbar/toolbar-sub-menu-item.jsx +236 -0
- package/src/toolbar/toolbar-sub-menu.jsx +252 -0
- package/src/toolbar/toolbar-sub-panel.jsx +94 -0
- package/src/toolbar/toolbar-sub-utils.js +86 -0
- package/src/toolbar/toolbar.jsx +386 -148
- package/src/toolbar/toolbar.scss +63 -56
- package/src/tooltip/tooltip.jsx +65 -12
- package/stats.html +1 -1
- package/assets/images/palette/close_32.svg +0 -1
- package/assets/images/palette/palette_close.svg +0 -4
- package/assets/images/palette/palette_grid_deselected.svg +0 -2
- package/assets/images/palette/palette_grid_hover.svg +0 -2
- package/assets/images/palette/palette_grid_selected.svg +0 -2
- package/assets/images/palette/palette_list_deselected.svg +0 -1
- package/assets/images/palette/palette_list_hover.svg +0 -1
- package/assets/images/palette/palette_list_selected.svg +0 -1
- package/assets/images/palette/palette_open.svg +0 -4
- package/assets/images/zoom_to_fit.svg +0 -8
- package/dist/canvas-controller-1e71b405.js +0 -2
- package/dist/canvas-controller-1e71b405.js.map +0 -1
- package/dist/canvas-controller-4bed5320.js +0 -2
- package/dist/canvas-controller-4bed5320.js.map +0 -1
- package/dist/common-canvas-097c5169.js +0 -2
- package/dist/common-canvas-097c5169.js.map +0 -1
- package/dist/common-canvas-e13c0858.js +0 -2
- package/dist/common-canvas-e13c0858.js.map +0 -1
- package/dist/common-properties-706cef87.js +0 -2
- package/dist/common-properties-706cef87.js.map +0 -1
- package/dist/common-properties-9bd69b61.js +0 -2
- package/dist/common-properties-9bd69b61.js.map +0 -1
- package/dist/context-menu-wrapper-3a7fdec8.js +0 -2
- package/dist/context-menu-wrapper-3a7fdec8.js.map +0 -1
- package/dist/context-menu-wrapper-fc85d853.js +0 -2
- package/dist/context-menu-wrapper-fc85d853.js.map +0 -1
- package/dist/toolbar-918ab52e.js +0 -2
- package/dist/toolbar-918ab52e.js.map +0 -1
- package/dist/toolbar-fdb750f9.js +0 -2
- package/dist/toolbar-fdb750f9.js.map +0 -1
- package/src/palette/palette-dialog-topbar-three-way-icon.jsx +0 -82
- package/src/toolbar/toolbar-action-sub-area.jsx +0 -126
- package/src/toolbar/toolbar-overflow-menu.jsx +0 -77
package/src/toolbar/toolbar.scss
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2017-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
-
|
|
230
|
+
.toolbar-icon-label {
|
|
231
|
+
line-height: 16px;
|
|
226
232
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
233
|
+
&.before {
|
|
234
|
+
padding-right: 8px;
|
|
235
|
+
}
|
|
230
236
|
|
|
231
|
-
|
|
232
|
-
|
|
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
|
-
|
|
248
|
+
.toolbar-up-down-chevron {
|
|
236
249
|
padding-left: 8px;
|
|
237
|
-
|
|
238
|
-
|
|
250
|
+
height: 16px;
|
|
251
|
+
pointer-events: none;
|
|
239
252
|
}
|
|
240
|
-
}
|
|
241
253
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
-
|
|
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-
|
|
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:
|
|
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:
|
|
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
|
+
|
package/src/tooltip/tooltip.jsx
CHANGED
|
@@ -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
|
|
355
|
-
|
|
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 = (<
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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
|
-
|
|
416
|
-
|
|
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" />
|