@elyra/canvas 12.13.0 → 12.14.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-controller-8e2bb291.js +2 -0
- package/dist/canvas-controller-8e2bb291.js.map +1 -0
- package/dist/canvas-controller-bd0d8d59.js +2 -0
- package/dist/canvas-controller-bd0d8d59.js.map +1 -0
- package/dist/common-canvas-69fe4a67.js +2 -0
- package/dist/common-canvas-69fe4a67.js.map +1 -0
- package/dist/common-canvas-f5e4af65.js +2 -0
- package/dist/common-canvas-f5e4af65.js.map +1 -0
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/common-properties-40648163.js +2 -0
- package/dist/common-properties-40648163.js.map +1 -0
- package/dist/common-properties-6d839df1.js +2 -0
- package/dist/common-properties-6d839df1.js.map +1 -0
- package/dist/{flexible-table-f88dfef1.js → flexible-table-d3598aa8.js} +1 -1
- package/dist/{flexible-table-f88dfef1.js.map → flexible-table-d3598aa8.js.map} +1 -1
- package/dist/{flexible-table-b31e92b8.js → flexible-table-fe7fbc13.js} +1 -1
- package/dist/{flexible-table-b31e92b8.js.map → flexible-table-fe7fbc13.js.map} +1 -1
- package/dist/{index-b6f098b8.js → index-669f95a7.js} +2 -2
- package/dist/{index-b6f098b8.js.map → index-669f95a7.js.map} +1 -1
- package/dist/{index-f44d40bc.js → index-6d3404e1.js} +2 -2
- package/dist/{index-f44d40bc.js.map → index-6d3404e1.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/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.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-29ec7983.js +2 -0
- package/dist/toolbar-29ec7983.js.map +1 -0
- package/dist/toolbar-3f4b173f.js +2 -0
- package/dist/toolbar-3f4b173f.js.map +1 -0
- package/locales/common-canvas/locales/en.json +15 -2
- package/locales/common-canvas/locales/eo.json +14 -1
- package/package.json +2 -1
- package/src/common-canvas/canvas-controller.js +17 -1
- package/src/common-canvas/cc-bottom-panel.jsx +37 -21
- package/src/common-canvas/cc-central-items.jsx +1 -1
- package/src/common-canvas/cc-contents.jsx +10 -0
- package/src/common-canvas/cc-text-toolbar.jsx +141 -0
- package/src/common-canvas/cc-toolbar.jsx +8 -6
- package/src/common-canvas/common-canvas.scss +48 -3
- package/src/common-canvas/svg-canvas-d3.scss +159 -16
- package/src/common-canvas/svg-canvas-renderer.js +204 -26
- package/src/common-canvas/svg-canvas-utils-markdown.js +515 -0
- package/src/common-properties/components/control-item/control-item.scss +1 -1
- package/src/common-properties/components/flexible-table/flexible-table.scss +1 -1
- package/src/common-properties/controls/checkbox/checkbox.jsx +1 -1
- package/src/common-properties/controls/checkboxset/checkboxset.jsx +36 -11
- package/src/common-properties/controls/checkboxset/checkboxset.scss +6 -0
- package/src/common-properties/controls/radioset/radioset.jsx +25 -1
- package/src/common-properties/controls/radioset/radioset.scss +19 -0
- package/src/common-properties/form/ControlInfo.js +3 -0
- package/src/common-properties/form/EditorForm.js +24 -0
- package/src/common-properties/properties-controller.js +23 -10
- package/src/common-properties/util/L10nProvider.js +6 -0
- package/src/object-model/config-utils.js +1 -0
- package/src/object-model/layout-dimensions.js +10 -0
- package/src/object-model/object-model.js +12 -0
- package/src/object-model/redux/canvas-store.js +4 -1
- package/src/object-model/redux/reducers/bottompanel.js +1 -3
- package/src/object-model/redux/reducers/texttoolbar.js +29 -0
- package/src/toolbar/toolbar-action-item.jsx +9 -6
- package/src/toolbar/toolbar-overflow-item.jsx +1 -0
- package/src/toolbar/toolbar.jsx +12 -15
- package/src/tooltip/tooltip.jsx +13 -4
- package/stats.html +1 -1
- package/dist/canvas-controller-40beba7d.js +0 -2
- package/dist/canvas-controller-40beba7d.js.map +0 -1
- package/dist/canvas-controller-f62a8ef7.js +0 -2
- package/dist/canvas-controller-f62a8ef7.js.map +0 -1
- package/dist/common-canvas-f0f1afd7.js +0 -2
- package/dist/common-canvas-f0f1afd7.js.map +0 -1
- package/dist/common-canvas-feb8cd7a.js +0 -2
- package/dist/common-canvas-feb8cd7a.js.map +0 -1
- package/dist/common-properties-1d4c875b.js +0 -2
- package/dist/common-properties-1d4c875b.js.map +0 -1
- package/dist/common-properties-da3999f5.js +0 -2
- package/dist/common-properties-da3999f5.js.map +0 -1
- package/dist/toolbar-2baadd0f.js +0 -2
- package/dist/toolbar-2baadd0f.js.map +0 -1
- package/dist/toolbar-d07d4d8a.js +0 -2
- package/dist/toolbar-d07d4d8a.js.map +0 -1
|
@@ -29,12 +29,31 @@
|
|
|
29
29
|
display: inline-flex;
|
|
30
30
|
flex-wrap: wrap;
|
|
31
31
|
.properties-radioset-panel {
|
|
32
|
+
display: flex;
|
|
33
|
+
height: auto;
|
|
34
|
+
align-items: center;
|
|
32
35
|
margin-bottom: 0;
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
.properties-radioset-panel {
|
|
36
39
|
margin-bottom: $spacing-02;
|
|
37
40
|
margin-right: $spacing-04;
|
|
41
|
+
display: grid;
|
|
42
|
+
grid-template-columns: 1fr 8fr;
|
|
43
|
+
grid-template-rows: auto;
|
|
44
|
+
grid-template-areas:
|
|
45
|
+
"radio tooltip"
|
|
46
|
+
"panel panel";
|
|
47
|
+
.bx--radio-button-wrapper{
|
|
48
|
+
grid-area: radio;
|
|
49
|
+
margin-right: 0; // We removed the space between radio & tooltip to position it correctly
|
|
50
|
+
}
|
|
51
|
+
.tooltip-container{
|
|
52
|
+
grid-area: tooltip;
|
|
53
|
+
}
|
|
54
|
+
.properties-control-nested-panel{
|
|
55
|
+
grid-area: panel;
|
|
56
|
+
}
|
|
38
57
|
&:last-of-type {
|
|
39
58
|
margin-bottom: 0; // don't want margin when last radio button in group
|
|
40
59
|
}
|
|
@@ -570,6 +570,11 @@ function _makeControl(parameterMetadata, paramName, group, structureDefinition,
|
|
|
570
570
|
if (parameter.getRole() === ParamRole.ENUM) {
|
|
571
571
|
valueLabels = _parameterValueLabels(parameter, l10nProvider);
|
|
572
572
|
}
|
|
573
|
+
|
|
574
|
+
let valueDescs;
|
|
575
|
+
if (parameter.getRole() === ParamRole.ENUM) {
|
|
576
|
+
valueDescs = _parameterValueDescription(parameter, l10nProvider);
|
|
577
|
+
}
|
|
573
578
|
let action;
|
|
574
579
|
if (!isSubControl && parameter.actionRef) {
|
|
575
580
|
action = _makeAction(actionMetadata.getAction(parameter.actionRef), l10nProvider);
|
|
@@ -587,6 +592,7 @@ function _makeControl(parameterMetadata, paramName, group, structureDefinition,
|
|
|
587
592
|
settings.orientation = orientation;
|
|
588
593
|
settings.values = parameter.getValidValues();
|
|
589
594
|
settings.valueLabels = valueLabels;
|
|
595
|
+
settings.valueDescs = valueDescs;
|
|
590
596
|
settings.valueIcons = parameter.valueIcons;
|
|
591
597
|
settings.sortable = parameter.sortable;
|
|
592
598
|
settings.filterable = parameter.filterable;
|
|
@@ -761,6 +767,24 @@ function _parameterValueLabels(parameter, l10nProvider) {
|
|
|
761
767
|
return [];
|
|
762
768
|
}
|
|
763
769
|
|
|
770
|
+
function _parameterValueDescription(parameter, l10nProvider) {
|
|
771
|
+
if (Array.isArray(parameter.getValidValues())) {
|
|
772
|
+
let key;
|
|
773
|
+
if (parameter.resource_key) {
|
|
774
|
+
key = parameter.resource_key;
|
|
775
|
+
} else {
|
|
776
|
+
key = parameter.name;
|
|
777
|
+
}
|
|
778
|
+
const paramDescs = [];
|
|
779
|
+
parameter.getValidValues().forEach(function(paramValue) {
|
|
780
|
+
paramDescs.push(l10nProvider.l10nValueDesc(key, String(paramValue)));
|
|
781
|
+
});
|
|
782
|
+
return paramDescs;
|
|
783
|
+
}
|
|
784
|
+
return [];
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
|
|
764
788
|
export {
|
|
765
789
|
makePrimaryTab, _makeControl as makeControl
|
|
766
790
|
};
|
|
@@ -1051,10 +1051,11 @@ export default class PropertiesController {
|
|
|
1051
1051
|
/*
|
|
1052
1052
|
* return the property value for the given 'inPropertyId'
|
|
1053
1053
|
* options - optional object of config options where
|
|
1054
|
-
* filterHiddenDisabled: true - filter out values from controls
|
|
1054
|
+
* filterHiddenDisabled: true - filter out values from controls having state "hidden" or "disabled"
|
|
1055
1055
|
* applyProperties: true - this function is called from PropertiesMain.applyPropertiesEditing()
|
|
1056
|
-
* filterHidden: true - filter out values from controls
|
|
1057
|
-
* filterDisabled: true - filter out values from controls
|
|
1056
|
+
* filterHidden: true - filter out values from controls having state "hidden"
|
|
1057
|
+
* filterDisabled: true - filter out values from controls having state "disabled"
|
|
1058
|
+
* filterHiddenControls: true - filter out values from controls having type "hidden"
|
|
1058
1059
|
*/
|
|
1059
1060
|
getPropertyValue(inPropertyId, options, defaultValue) {
|
|
1060
1061
|
const propertyId = this.convertPropertyId(inPropertyId);
|
|
@@ -1064,10 +1065,16 @@ export default class PropertiesController {
|
|
|
1064
1065
|
// don't return hidden/disabled values
|
|
1065
1066
|
const filterHidden = options && (options.filterHiddenDisabled || options.filterHidden);
|
|
1066
1067
|
const filterDisabled = options && (options.filterHiddenDisabled || options.filterDisabled);
|
|
1067
|
-
|
|
1068
|
+
const filterHiddenControls = options && options.filterHiddenControls;
|
|
1069
|
+
if (filterHidden || filterDisabled || filterHiddenControls) {
|
|
1068
1070
|
// top level value
|
|
1069
1071
|
const controlState = this.getControlState(propertyId);
|
|
1070
|
-
|
|
1072
|
+
const controlType = this.getControlType(propertyId);
|
|
1073
|
+
if (
|
|
1074
|
+
(controlState === STATES.DISABLED && filterDisabled) ||
|
|
1075
|
+
(controlState === STATES.HIDDEN && filterHidden) ||
|
|
1076
|
+
(controlType === ControlType.HIDDEN && filterHiddenControls)
|
|
1077
|
+
) {
|
|
1071
1078
|
return filteredValue;
|
|
1072
1079
|
}
|
|
1073
1080
|
// copy array to modify it and clear out disabled/hidden values
|
|
@@ -1083,7 +1090,12 @@ export default class PropertiesController {
|
|
|
1083
1090
|
col: colIdx
|
|
1084
1091
|
};
|
|
1085
1092
|
const valueState = this.getControlState(colPropertyId);
|
|
1086
|
-
|
|
1093
|
+
const valueType = this.getControlType(colPropertyId);
|
|
1094
|
+
if (
|
|
1095
|
+
(valueState === STATES.DISABLED && filterDisabled) ||
|
|
1096
|
+
(valueState === STATES.HIDDEN && filterHidden) ||
|
|
1097
|
+
(valueType === ControlType.HIDDEN && filterHiddenControls)
|
|
1098
|
+
) {
|
|
1087
1099
|
filteredValue[rowIdx][colIdx] = null;
|
|
1088
1100
|
}
|
|
1089
1101
|
}
|
|
@@ -1121,15 +1133,16 @@ export default class PropertiesController {
|
|
|
1121
1133
|
/*
|
|
1122
1134
|
* return the property values for all controls
|
|
1123
1135
|
* options - optional object of config options where
|
|
1124
|
-
* filterHiddenDisabled: true - filter out values from controls
|
|
1136
|
+
* filterHiddenDisabled: true - filter out values from controls having state "hidden" or "disabled"
|
|
1125
1137
|
* applyProperties: true - this function is called from PropertiesMain.applyPropertiesEditing()
|
|
1126
|
-
* filterHidden: true - filter out values from controls
|
|
1127
|
-
* filterDisabled: true - filter out values from controls
|
|
1138
|
+
* filterHidden: true - filter out values from controls having state "hidden"
|
|
1139
|
+
* filterDisabled: true - filter out values from controls having state "disabled"
|
|
1140
|
+
* filterHiddenControls: true - filter out values from controls having type "hidden"
|
|
1128
1141
|
*/
|
|
1129
1142
|
getPropertyValues(options) {
|
|
1130
1143
|
const propertyValues = this.propertiesStore.getPropertyValues();
|
|
1131
1144
|
let returnValues = propertyValues;
|
|
1132
|
-
if (options && (options.filterHiddenDisabled || options.filterHidden || options.filterDisabled)) {
|
|
1145
|
+
if (options && (options.filterHiddenDisabled || options.filterHidden || options.filterDisabled || options.filterHiddenControls)) {
|
|
1133
1146
|
const filteredValues = {};
|
|
1134
1147
|
for (const propKey in propertyValues) {
|
|
1135
1148
|
if (!has(propertyValues, propKey)) {
|
|
@@ -77,6 +77,12 @@ export class L10nProvider {
|
|
|
77
77
|
const lookupKey = baseKey + "." + value + ".label";
|
|
78
78
|
return this.l10n(lookupKey, value);
|
|
79
79
|
}
|
|
80
|
+
|
|
81
|
+
l10nValueDesc(baseKey, value) {
|
|
82
|
+
const lookupKey = baseKey + "." + value + ".desc";
|
|
83
|
+
const desc = this.l10n(lookupKey, value);
|
|
84
|
+
return (desc !== value ? desc : null);
|
|
85
|
+
}
|
|
80
86
|
}
|
|
81
87
|
|
|
82
88
|
export class ResourceDef {
|
|
@@ -75,6 +75,7 @@ export default class CanvasUtils {
|
|
|
75
75
|
enablePanIntoViewOnOpen: false,
|
|
76
76
|
enableZoomIntoSubFlows: false,
|
|
77
77
|
enableBrowserEditMenu: true,
|
|
78
|
+
enableMarkdownInComments: false,
|
|
78
79
|
enableAutoLinkOnlyFromSelNodes: false,
|
|
79
80
|
enableSaveZoom: "None",
|
|
80
81
|
enableSnapToGridType: "None",
|
|
@@ -358,6 +358,11 @@ const portsHorizontalDefaultLayout = {
|
|
|
358
358
|
// Comment port (circle) radius
|
|
359
359
|
commentPortRadius: 5,
|
|
360
360
|
|
|
361
|
+
// Position of the comment toolbar as an offset from the comment position
|
|
362
|
+
// (which is the top left corner of the comment bounding box).
|
|
363
|
+
commentToolbarPosX: -2,
|
|
364
|
+
commentToolbarPosY: -44,
|
|
365
|
+
|
|
361
366
|
// ---------------------------------------------------------------------------
|
|
362
367
|
// Layout values for operations
|
|
363
368
|
// ---------------------------------------------------------------------------
|
|
@@ -742,6 +747,11 @@ const portsVerticalDefaultLayout = {
|
|
|
742
747
|
// Comment port (circle) radius
|
|
743
748
|
commentPortRadius: 5,
|
|
744
749
|
|
|
750
|
+
// Position of the comment toolbar as an offset from the comment position
|
|
751
|
+
// (which is the top left corner of the comment bounding box).
|
|
752
|
+
commentToolbarPosX: -2,
|
|
753
|
+
commentToolbarPosY: -44,
|
|
754
|
+
|
|
745
755
|
// ---------------------------------------------------------------------------
|
|
746
756
|
// Layout values for operations
|
|
747
757
|
// ---------------------------------------------------------------------------
|
|
@@ -1442,6 +1442,10 @@ export default class ObjectModel {
|
|
|
1442
1442
|
return this.store.isBottomPanelOpen();
|
|
1443
1443
|
}
|
|
1444
1444
|
|
|
1445
|
+
setBottomPanelHeight(ht) {
|
|
1446
|
+
this.store.dispatch({ type: "SET_BOTTOM_PANEL_CONFIG", data: { config: { panelHeight: ht } } });
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1445
1449
|
// ---------------------------------------------------------------------------
|
|
1446
1450
|
// Clone methods
|
|
1447
1451
|
// ---------------------------------------------------------------------------
|
|
@@ -2380,4 +2384,12 @@ export default class ObjectModel {
|
|
|
2380
2384
|
isTooltipOpen() {
|
|
2381
2385
|
return this.store.isTooltipOpen();
|
|
2382
2386
|
}
|
|
2387
|
+
|
|
2388
|
+
// ---------------------------------------------------------------------------
|
|
2389
|
+
// Text Toolbar methods
|
|
2390
|
+
// ---------------------------------------------------------------------------
|
|
2391
|
+
setTextToolbarDef(textToolbarDef) {
|
|
2392
|
+
this.store.dispatch({ type: "SET_TEXT_TOOLBAR_DEF", data: { textToolbarDef: textToolbarDef } });
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2383
2395
|
}
|
|
@@ -28,6 +28,7 @@ import bottompanel from "./reducers/bottompanel.js";
|
|
|
28
28
|
import breadcrumbs from "./reducers/breadcrumbs.js";
|
|
29
29
|
import canvasconfig from "./reducers/canvasconfig.js";
|
|
30
30
|
import canvastoolbar from "./reducers/canvastoolbar.js";
|
|
31
|
+
import texttoolbar from "./reducers/texttoolbar.js";
|
|
31
32
|
import notifications from "./reducers/notifications.js";
|
|
32
33
|
import selectioninfo from "./reducers/selectioninfo.js";
|
|
33
34
|
import notificationpanel from "./reducers/notificationpanel.js";
|
|
@@ -50,6 +51,7 @@ export default class CanavasStore {
|
|
|
50
51
|
externalpipelineflows,
|
|
51
52
|
tooltip,
|
|
52
53
|
canvastoolbar,
|
|
54
|
+
texttoolbar,
|
|
53
55
|
contextmenu,
|
|
54
56
|
rightflyout,
|
|
55
57
|
bottompanel
|
|
@@ -66,9 +68,10 @@ export default class CanavasStore {
|
|
|
66
68
|
externalpipelineflows: [],
|
|
67
69
|
tooltip: {},
|
|
68
70
|
canvastoolbar: {},
|
|
71
|
+
texttoolbar: { isOpen: false },
|
|
69
72
|
contextmenu: { menuDef: [] },
|
|
70
73
|
rightflyout: {},
|
|
71
|
-
bottompanel: {}
|
|
74
|
+
bottompanel: { panelHeight: 393 }
|
|
72
75
|
};
|
|
73
76
|
|
|
74
77
|
let enableDevTools = false;
|
|
@@ -18,9 +18,7 @@ export default (state = {}, action) => {
|
|
|
18
18
|
switch (action.type) {
|
|
19
19
|
case "SET_BOTTOM_PANEL_CONFIG": {
|
|
20
20
|
if (action.data.config) {
|
|
21
|
-
return {
|
|
22
|
-
content: action.data.config.content,
|
|
23
|
-
isOpen: action.data.config.isOpen };
|
|
21
|
+
return Object.assign({}, state, action.data.config);
|
|
24
22
|
}
|
|
25
23
|
return state;
|
|
26
24
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 Elyra Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export default (state = {}, action) => {
|
|
18
|
+
switch (action.type) {
|
|
19
|
+
case "SET_TEXT_TOOLBAR_DEF": {
|
|
20
|
+
if (action.data.textToolbarDef) {
|
|
21
|
+
return Object.assign({}, state, action.data.textToolbarDef);
|
|
22
|
+
}
|
|
23
|
+
return state;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
default:
|
|
27
|
+
return state;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -138,8 +138,8 @@ class ToolbarActionItem extends React.Component {
|
|
|
138
138
|
return null;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
actionClickHandler() {
|
|
142
|
-
this.props.toolbarActionHandler(this.props.actionObj.action);
|
|
141
|
+
actionClickHandler(evt) {
|
|
142
|
+
this.props.toolbarActionHandler(this.props.actionObj.action, evt);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
generateButton(actionObj) {
|
|
@@ -199,12 +199,13 @@ class ToolbarActionItem extends React.Component {
|
|
|
199
199
|
wrapInTooltip(content) {
|
|
200
200
|
if (!this.props.overflow && (this.showLabelAsTip(this.props.actionObj) || this.props.actionObj.tooltip)) {
|
|
201
201
|
const actionName = this.generateActionName();
|
|
202
|
-
const
|
|
202
|
+
const tip = this.props.actionObj.tooltip ? this.props.actionObj.tooltip : this.props.actionObj.label;
|
|
203
203
|
const tooltipId = actionName + "-" + this.props.instanceId + "-tooltip";
|
|
204
|
-
const enableTooltip = this.props.actionObj.enable
|
|
204
|
+
const enableTooltip = this.props.actionObj.enable || this.props.actionObj.jsx; // JSX 'tools' don't have enable attr so always display a tooltip for them.
|
|
205
|
+
const direction = this.props.tooltipDirection ? this.props.tooltipDirection : "bottom";
|
|
205
206
|
|
|
206
207
|
return (
|
|
207
|
-
<Tooltip id={tooltipId} tip={
|
|
208
|
+
<Tooltip id={tooltipId} tip={tip} disable={!enableTooltip} className="icon-tooltip" direction={direction}>
|
|
208
209
|
{content}
|
|
209
210
|
</Tooltip>
|
|
210
211
|
);
|
|
@@ -282,9 +283,11 @@ ToolbarActionItem.propTypes = {
|
|
|
282
283
|
jsx: PropTypes.object,
|
|
283
284
|
tooltip: PropTypes.oneOfType([
|
|
284
285
|
PropTypes.string,
|
|
285
|
-
PropTypes.object
|
|
286
|
+
PropTypes.object,
|
|
287
|
+
PropTypes.func
|
|
286
288
|
])
|
|
287
289
|
}),
|
|
290
|
+
tooltipDirection: PropTypes.oneOf(["top", "bottom"]),
|
|
288
291
|
toolbarActionHandler: PropTypes.func.isRequired,
|
|
289
292
|
instanceId: PropTypes.number.isRequired,
|
|
290
293
|
overflow: PropTypes.bool,
|
|
@@ -49,6 +49,7 @@ class ToolbarOverflowItem extends React.Component {
|
|
|
49
49
|
<div className={className} >
|
|
50
50
|
<div className={"toolbar-overflow-item"}>
|
|
51
51
|
<Button kind="ghost"
|
|
52
|
+
tabIndex={-1}
|
|
52
53
|
onClick={this.toggleExtendedMenu}
|
|
53
54
|
onFocus={this.props.onFocus}
|
|
54
55
|
aria-label={this.props.label}
|
package/src/toolbar/toolbar.jsx
CHANGED
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import React from "react";
|
|
18
|
-
import { injectIntl } from "react-intl";
|
|
19
18
|
import PropTypes from "prop-types";
|
|
20
|
-
import defaultMessages from "../../locales/toolbar/locales/en.json";
|
|
21
19
|
import ReactResizeDetector from "react-resize-detector";
|
|
22
20
|
|
|
23
21
|
import ToolbarActionItem from "./toolbar-action-item.jsx";
|
|
@@ -205,6 +203,7 @@ class Toolbar extends React.Component {
|
|
|
205
203
|
<ToolbarActionItem
|
|
206
204
|
key={"toolbar-item-key-" + i}
|
|
207
205
|
actionObj={actionObj}
|
|
206
|
+
tooltipDirection={this.props.tooltipDirection}
|
|
208
207
|
toolbarActionHandler={this.props.toolbarActionHandler}
|
|
209
208
|
overflow={overflow}
|
|
210
209
|
instanceId={this.props.instanceId}
|
|
@@ -282,29 +281,27 @@ class Toolbar extends React.Component {
|
|
|
282
281
|
const rightItems = this.generateToolbarItems(this.rightBar, false, false);
|
|
283
282
|
|
|
284
283
|
const canvasToolbar = (
|
|
285
|
-
<
|
|
286
|
-
<
|
|
287
|
-
<div className="toolbar-
|
|
288
|
-
|
|
289
|
-
{leftItems}
|
|
290
|
-
</div>
|
|
291
|
-
<div className="toolbar-right-bar">
|
|
292
|
-
{rightItems}
|
|
293
|
-
</div>
|
|
284
|
+
<ReactResizeDetector handleWidth onResize={this.onToolbarResize}>
|
|
285
|
+
<div className="toolbar-div" instanceid={this.props.instanceId}>
|
|
286
|
+
<div className="toolbar-left-bar" onScroll={this.onScroll}>
|
|
287
|
+
{leftItems}
|
|
294
288
|
</div>
|
|
295
|
-
|
|
296
|
-
|
|
289
|
+
<div className="toolbar-right-bar">
|
|
290
|
+
{rightItems}
|
|
291
|
+
</div>
|
|
292
|
+
</div>
|
|
293
|
+
</ReactResizeDetector>
|
|
297
294
|
);
|
|
298
295
|
return canvasToolbar;
|
|
299
296
|
}
|
|
300
297
|
}
|
|
301
298
|
|
|
302
299
|
Toolbar.propTypes = {
|
|
303
|
-
intl: PropTypes.object.isRequired,
|
|
304
300
|
config: PropTypes.object.isRequired,
|
|
305
301
|
instanceId: PropTypes.number,
|
|
306
302
|
toolbarActionHandler: PropTypes.func,
|
|
303
|
+
tooltipDirection: PropTypes.string,
|
|
307
304
|
additionalText: PropTypes.object
|
|
308
305
|
};
|
|
309
306
|
|
|
310
|
-
export default
|
|
307
|
+
export default Toolbar;
|
package/src/tooltip/tooltip.jsx
CHANGED
|
@@ -378,6 +378,8 @@ class ToolTip extends React.Component {
|
|
|
378
378
|
{this.props.tip}
|
|
379
379
|
</div>
|
|
380
380
|
);
|
|
381
|
+
} else if ((typeof this.props.tip) === "function") {
|
|
382
|
+
tooltipContent = this.props.tip();
|
|
381
383
|
}
|
|
382
384
|
|
|
383
385
|
let tipClass = "common-canvas-tooltip";
|
|
@@ -400,9 +402,9 @@ class ToolTip extends React.Component {
|
|
|
400
402
|
}
|
|
401
403
|
}
|
|
402
404
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
405
|
+
let tooltip = null;
|
|
406
|
+
if (tooltipContent || link) {
|
|
407
|
+
tooltip = (
|
|
406
408
|
<Portal>
|
|
407
409
|
<div data-id={this.props.id} className={tipClass} aria-hidden={!this.state.isTooltipVisible} direction={this.props.direction}>
|
|
408
410
|
<svg id="tipArrow" x="0px" y="0px" viewBox="0 0 9.1 16.1">
|
|
@@ -413,13 +415,20 @@ class ToolTip extends React.Component {
|
|
|
413
415
|
{link}
|
|
414
416
|
</div>
|
|
415
417
|
</Portal>
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
return (
|
|
422
|
+
<div className="tooltip-container">
|
|
423
|
+
{triggerContent}
|
|
424
|
+
{tooltip}
|
|
416
425
|
</div>
|
|
417
426
|
);
|
|
418
427
|
}
|
|
419
428
|
}
|
|
420
429
|
|
|
421
430
|
ToolTip.propTypes = {
|
|
422
|
-
tip: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
|
|
431
|
+
tip: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]).isRequired,
|
|
423
432
|
link: PropTypes.object,
|
|
424
433
|
tooltipLinkHandler: PropTypes.func,
|
|
425
434
|
direction: PropTypes.oneOf(["left", "right", "top", "bottom"]),
|