@elyra/canvas 12.10.0 → 12.11.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-7f93e705.js +2 -0
- package/dist/canvas-constants-7f93e705.js.map +1 -0
- package/dist/canvas-constants-ac5daafb.js +2 -0
- package/dist/canvas-constants-ac5daafb.js.map +1 -0
- package/dist/canvas-controller-183ff6a7.js +2 -0
- package/dist/canvas-controller-183ff6a7.js.map +1 -0
- package/dist/canvas-controller-d70a731e.js +2 -0
- package/dist/canvas-controller-d70a731e.js.map +1 -0
- package/dist/canvas-logger-815781bb.js +2 -0
- package/dist/canvas-logger-815781bb.js.map +1 -0
- package/dist/canvas-logger-a0f1beaa.js +2 -0
- package/dist/canvas-logger-a0f1beaa.js.map +1 -0
- package/dist/common-canvas-3e832a84.js +2 -0
- package/dist/common-canvas-3e832a84.js.map +1 -0
- package/dist/common-canvas-c50cb3f3.js +2 -0
- package/dist/common-canvas-c50cb3f3.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-4f471b2b.js +2 -0
- package/dist/common-properties-4f471b2b.js.map +1 -0
- package/dist/common-properties-9161cd27.js +2 -0
- package/dist/common-properties-9161cd27.js.map +1 -0
- package/dist/datarecord-metadata-v3-schema-bda88f2e.js +2 -0
- package/dist/datarecord-metadata-v3-schema-bda88f2e.js.map +1 -0
- package/dist/datarecord-metadata-v3-schema-d7ad05cd.js +2 -0
- package/dist/datarecord-metadata-v3-schema-d7ad05cd.js.map +1 -0
- package/dist/en-2ed89528.js +2 -0
- package/dist/en-2ed89528.js.map +1 -0
- package/dist/en-e93855cc.js +2 -0
- package/dist/en-e93855cc.js.map +1 -0
- package/dist/extends-39f57612.js +7 -0
- package/dist/extends-39f57612.js.map +1 -0
- package/dist/extends-51d9ddcc.js +7 -0
- package/dist/extends-51d9ddcc.js.map +1 -0
- package/dist/flexible-table-154a3359.js +2 -0
- package/dist/flexible-table-154a3359.js.map +1 -0
- package/dist/flexible-table-5e4a1e6d.js +2 -0
- package/dist/flexible-table-5e4a1e6d.js.map +1 -0
- package/dist/icon-811ffddd.js +2 -0
- package/dist/icon-811ffddd.js.map +1 -0
- package/dist/icon-d6909a68.js +2 -0
- package/dist/icon-d6909a68.js.map +1 -0
- package/dist/index-4fd90a14.js +2 -0
- package/dist/index-4fd90a14.js.map +1 -0
- package/dist/index-6d138021.js +2 -0
- package/dist/index-6d138021.js.map +1 -0
- package/dist/isArrayLikeObject-31e5e646.js +2 -0
- package/dist/isArrayLikeObject-31e5e646.js.map +1 -0
- package/dist/isArrayLikeObject-7c33c7fd.js +2 -0
- package/dist/isArrayLikeObject-7c33c7fd.js.map +1 -0
- package/dist/lib/canvas-controller.es.js +2 -0
- package/dist/lib/canvas-controller.es.js.map +1 -0
- package/dist/lib/canvas-controller.js +2 -0
- package/dist/lib/canvas-controller.js.map +1 -0
- 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.es.js.map +1 -1
- package/dist/lib/context-menu.js +1 -1
- package/dist/lib/context-menu.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/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-335252dd.js +2 -0
- package/dist/toolbar-335252dd.js.map +1 -0
- package/dist/toolbar-85e6c77b.js +2 -0
- package/dist/toolbar-85e6c77b.js.map +1 -0
- package/locales/command-actions/locales/en.json +7 -1
- package/locales/command-actions/locales/eo.json +7 -1
- package/locales/command-actions/locales/index.js +3 -1
- package/locales/command-actions/locales/ko.json +9 -0
- package/locales/common-canvas/locales/en.json +1 -0
- package/locales/common-canvas/locales/eo.json +1 -0
- package/locales/common-canvas/locales/index.js +3 -1
- package/locales/common-canvas/locales/ko.json +32 -0
- package/locales/common-properties/locales/index.js +3 -1
- package/locales/common-properties/locales/ko.json +93 -0
- package/locales/palette/locales/index.js +3 -1
- package/locales/palette/locales/ko.json +10 -0
- package/locales/toolbar/locales/index.js +3 -1
- package/locales/toolbar/locales/ko.json +8 -0
- package/package.json +7 -3
- package/rollup.config.js +10 -7
- package/src/color-picker/color-picker-panel.jsx +61 -0
- package/src/color-picker/color-picker.jsx +37 -0
- package/src/color-picker/color-picker.scss +46 -0
- package/src/command-actions/colorSelectedObjectsAction.js +72 -0
- package/src/command-actions/deleteObjectsAction.js +16 -11
- package/src/command-actions/pasteAction.js +50 -21
- package/src/common-canvas/canvas-controller.js +32 -5
- package/src/common-canvas/cc-bottom-panel.jsx +34 -37
- package/src/common-canvas/cc-contents.jsx +114 -12
- package/src/common-canvas/cc-toolbar.jsx +3 -2
- package/src/common-canvas/common-canvas-utils.js +39 -78
- package/src/common-canvas/common-canvas.scss +28 -14
- package/src/common-canvas/constants/canvas-constants.js +17 -16
- package/src/common-canvas/label-util.js +1 -1
- package/src/common-canvas/svg-canvas-d3.js +20 -107
- package/src/common-canvas/svg-canvas-d3.scss +67 -6
- package/src/common-canvas/svg-canvas-pipeline.js +201 -0
- package/src/common-canvas/svg-canvas-renderer.js +155 -164
- package/src/common-canvas/svg-canvas-utils-links.js +3 -3
- package/src/common-canvas/svg-canvas-utils-nodes.js +22 -34
- package/src/common-properties/actions.js +4 -0
- package/src/common-properties/components/field-picker/field-picker.jsx +33 -36
- package/src/common-properties/components/field-picker/field-picker.scss +20 -23
- package/src/common-properties/components/flexible-table/flexible-table.jsx +46 -31
- package/src/common-properties/components/flexible-table/flexible-table.scss +14 -17
- package/src/common-properties/components/properties-buttons/properties-buttons.jsx +28 -21
- package/src/common-properties/components/table-buttons/table-buttons.jsx +3 -1
- package/src/common-properties/components/table-buttons/table-buttons.scss +8 -8
- package/src/common-properties/components/title-editor/title-editor.jsx +31 -4
- package/src/common-properties/components/title-editor/title-editor.scss +30 -5
- package/src/common-properties/components/virtualized-table/virtualized-table.jsx +120 -29
- package/src/common-properties/components/virtualized-table/virtualized-table.scss +72 -8
- package/src/common-properties/constants/constants.js +5 -1
- package/src/common-properties/constants/form-constants.js +1 -0
- package/src/common-properties/controls/abstract-table.jsx +12 -11
- package/src/common-properties/controls/abstract-table.scss +6 -2
- package/src/common-properties/controls/dropdown/dropdown.scss +4 -0
- package/src/common-properties/controls/expression/expression-builder/expression-select-field-function.jsx +2 -2
- package/src/common-properties/controls/passwordfield/passwordfield.jsx +2 -2
- package/src/common-properties/controls/readonlytable/readonlytable.jsx +4 -2
- package/src/common-properties/controls/selectcolumns/selectcolumns.scss +0 -19
- package/src/common-properties/controls/someofselect/someofselect.scss +2 -2
- package/src/common-properties/form/ControlInfo.js +8 -0
- package/src/common-properties/form/EditorForm.js +4 -0
- package/src/common-properties/form/ParameterInfo.js +4 -0
- package/src/common-properties/panels/sub-panel/cell.jsx +18 -23
- package/src/common-properties/panels/sub-panel/sub-panel.scss +5 -22
- package/src/common-properties/properties-controller.js +18 -0
- package/src/common-properties/properties-main/properties-main.jsx +15 -9
- package/src/common-properties/properties-main/properties-main.scss +9 -2
- package/src/common-properties/properties-store.js +27 -1
- package/src/common-properties/reducers/properties-settings.js +17 -1
- package/src/context-menu/common-context-menu.jsx +74 -29
- package/src/context-menu/context-menu-wrapper.jsx +2 -2
- package/src/icons/icon.jsx +5 -46
- package/src/index.scss +1 -0
- package/src/object-model/api-pipeline.js +25 -42
- package/src/object-model/object-model.js +27 -3
- package/src/object-model/redux/canvas-store.js +68 -0
- package/src/object-model/redux/reducers/canvasinfo.js +36 -0
- package/src/object-model/redux/reducers/comments.js +58 -10
- package/src/object-model/redux/reducers/externalpipelineflows.js +1 -0
- package/src/object-model/redux/reducers/links.js +9 -7
- package/src/object-model/redux/reducers/selectioninfo.js +2 -1
- package/src/palette/palette-content-list-item.jsx +8 -1
- package/src/palette/palette-dialog-content-grid-node.jsx +8 -1
- package/src/palette/palette-flyout-utils.js +3 -3
- package/src/toolbar/toolbar-action-item.jsx +77 -14
- package/src/toolbar/toolbar-overflow-item.jsx +2 -3
- package/src/tooltip/tooltip.jsx +4 -1
- package/stats.html +1 -1
- package/dist/canvas-controller-5c90a709.js +0 -2
- package/dist/canvas-controller-5c90a709.js.map +0 -1
- package/dist/canvas-controller-a851a663.js +0 -2
- package/dist/canvas-controller-a851a663.js.map +0 -1
- package/dist/common-properties-3758e3b2.js +0 -2
- package/dist/common-properties-3758e3b2.js.map +0 -1
- package/dist/common-properties-6334cca1.js +0 -2
- package/dist/common-properties-6334cca1.js.map +0 -1
- package/dist/datarecord-metadata-v3-schema-3a2957c3.js +0 -2
- package/dist/datarecord-metadata-v3-schema-3a2957c3.js.map +0 -1
- package/dist/datarecord-metadata-v3-schema-82f2b977.js +0 -2
- package/dist/datarecord-metadata-v3-schema-82f2b977.js.map +0 -1
- package/dist/en-9e368daa.js +0 -2
- package/dist/en-9e368daa.js.map +0 -1
- package/dist/en-a3710fcf.js +0 -2
- package/dist/en-a3710fcf.js.map +0 -1
- package/dist/extends-41535aa9.js +0 -7
- package/dist/extends-41535aa9.js.map +0 -1
- package/dist/extends-76e6b8d2.js +0 -8
- package/dist/extends-76e6b8d2.js.map +0 -1
- package/dist/flexible-table-2bbb9e48.js +0 -2
- package/dist/flexible-table-2bbb9e48.js.map +0 -1
- package/dist/flexible-table-756ff86a.js +0 -2
- package/dist/flexible-table-756ff86a.js.map +0 -1
- package/dist/index-1eff5860.js +0 -2
- package/dist/index-1eff5860.js.map +0 -1
- package/dist/index-7fba99b9.js +0 -2
- package/dist/index-7fba99b9.js.map +0 -1
- package/dist/isEmpty-3550e76f.js +0 -2
- package/dist/isEmpty-3550e76f.js.map +0 -1
- package/dist/isEmpty-c6f783dd.js +0 -2
- package/dist/isEmpty-c6f783dd.js.map +0 -1
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
/* eslint arrow-body-style: ["off"] */
|
|
17
17
|
|
|
18
|
+
|
|
19
|
+
import CanvasUtils from "../../../common-canvas/common-canvas-utils.js";
|
|
20
|
+
|
|
18
21
|
export default (state = [], action) => {
|
|
19
22
|
switch (action.type) {
|
|
20
23
|
case "MOVE_OBJECTS":
|
|
@@ -53,15 +56,7 @@ export default (state = [], action) => {
|
|
|
53
56
|
|
|
54
57
|
|
|
55
58
|
case "ADD_COMMENT": {
|
|
56
|
-
const newComment =
|
|
57
|
-
id: action.data.id,
|
|
58
|
-
class_name: action.data.class_name,
|
|
59
|
-
content: action.data.content,
|
|
60
|
-
height: action.data.height,
|
|
61
|
-
width: action.data.width,
|
|
62
|
-
x_pos: action.data.x_pos,
|
|
63
|
-
y_pos: action.data.y_pos
|
|
64
|
-
};
|
|
59
|
+
const newComment = getCommentFromData(action.data);
|
|
65
60
|
return [
|
|
66
61
|
...state,
|
|
67
62
|
newComment
|
|
@@ -69,9 +64,10 @@ export default (state = [], action) => {
|
|
|
69
64
|
}
|
|
70
65
|
|
|
71
66
|
case "ADD_COMMENTS": {
|
|
67
|
+
const comments = action.data.commentsToAdd.map((cd) => getCommentFromData(cd));
|
|
72
68
|
return [
|
|
73
69
|
...state,
|
|
74
|
-
...
|
|
70
|
+
...comments
|
|
75
71
|
];
|
|
76
72
|
}
|
|
77
73
|
|
|
@@ -139,6 +135,20 @@ export default (state = [], action) => {
|
|
|
139
135
|
return comment;
|
|
140
136
|
});
|
|
141
137
|
|
|
138
|
+
case "SET_OBJECTS_COLOR_CLASS_NAME":
|
|
139
|
+
return state.map((comment) => {
|
|
140
|
+
const idx = action.data.objIds.indexOf(comment.id);
|
|
141
|
+
if (idx > -1) {
|
|
142
|
+
const newColorClass =
|
|
143
|
+
Array.isArray(action.data.newColorClass) ? (action.data.newColorClass[idx] || null) : action.data.newColorClass;
|
|
144
|
+
const className = replaceColorClass(comment.class_name, newColorClass);
|
|
145
|
+
const newComment = Object.assign({}, comment, { class_name: className });
|
|
146
|
+
return newComment;
|
|
147
|
+
}
|
|
148
|
+
return comment;
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
|
|
142
152
|
case "SET_OBJECTS_CLASS_NAME":
|
|
143
153
|
return state.map((comment) => {
|
|
144
154
|
const idx = action.data.objIds.indexOf(comment.id);
|
|
@@ -201,3 +211,41 @@ export default (state = [], action) => {
|
|
|
201
211
|
return state;
|
|
202
212
|
}
|
|
203
213
|
};
|
|
214
|
+
|
|
215
|
+
function replaceColorClass(className, newColorClass) {
|
|
216
|
+
let cn = "";
|
|
217
|
+
if (className) {
|
|
218
|
+
cn = removeCurrentColorClass(className);
|
|
219
|
+
cn = addNewColorClass(cn, newColorClass);
|
|
220
|
+
} else {
|
|
221
|
+
cn = newColorClass;
|
|
222
|
+
}
|
|
223
|
+
return cn;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function removeCurrentColorClass(className) {
|
|
227
|
+
const cn = className
|
|
228
|
+
.split(" ")
|
|
229
|
+
.filter((tok) => !CanvasUtils.getBkgColorClass(tok))
|
|
230
|
+
.join(" ");
|
|
231
|
+
return cn;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function addNewColorClass(className, newColorClass) {
|
|
235
|
+
return className ? className + " " + newColorClass : newColorClass;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function getCommentFromData(data) {
|
|
239
|
+
const newComment = {
|
|
240
|
+
id: data.id,
|
|
241
|
+
content: data.content,
|
|
242
|
+
height: data.height,
|
|
243
|
+
width: data.width,
|
|
244
|
+
x_pos: data.x_pos,
|
|
245
|
+
y_pos: data.y_pos
|
|
246
|
+
};
|
|
247
|
+
if (typeof data.class_name !== "undefined") {
|
|
248
|
+
newComment.class_name = data.class_name;
|
|
249
|
+
}
|
|
250
|
+
return newComment;
|
|
251
|
+
}
|
|
@@ -287,14 +287,16 @@ export default (state = [], action) => {
|
|
|
287
287
|
// to each of the selected nodes.
|
|
288
288
|
case "ADD_COMMENT": {
|
|
289
289
|
const createdLinks = [];
|
|
290
|
-
action.data.selectedObjectIds
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
290
|
+
if (action.data.selectedObjectIds) {
|
|
291
|
+
action.data.selectedObjectIds.forEach((objId, i) => {
|
|
292
|
+
createdLinks.push({
|
|
293
|
+
id: action.data.linkIds[i],
|
|
294
|
+
srcNodeId: action.data.id,
|
|
295
|
+
trgNodeId: action.data.selectedObjectIds[i],
|
|
296
|
+
type: COMMENT_LINK
|
|
297
|
+
});
|
|
296
298
|
});
|
|
297
|
-
}
|
|
299
|
+
}
|
|
298
300
|
return [
|
|
299
301
|
...state,
|
|
300
302
|
...createdLinks
|
|
@@ -29,9 +29,10 @@ export default (state = {}, action) => {
|
|
|
29
29
|
case "CLEAR_SELECTIONS":
|
|
30
30
|
return {};
|
|
31
31
|
|
|
32
|
+
case "ADD_PASTED_OBJECTS":
|
|
32
33
|
case "SET_SELECTIONS":
|
|
33
34
|
return {
|
|
34
|
-
pipelineId: action.
|
|
35
|
+
pipelineId: action.pipelineId,
|
|
35
36
|
selections: [...action.data.selections]
|
|
36
37
|
};
|
|
37
38
|
|
|
@@ -42,6 +42,7 @@ class PaletteContentListItem extends React.Component {
|
|
|
42
42
|
this.showShortDescription = this.showShortDescription.bind(this);
|
|
43
43
|
|
|
44
44
|
this.onDragStart = this.onDragStart.bind(this);
|
|
45
|
+
this.onDragEnd = this.onDragEnd.bind(this);
|
|
45
46
|
this.onDoubleClick = this.onDoubleClick.bind(this);
|
|
46
47
|
this.onMouseOver = this.onMouseOver.bind(this);
|
|
47
48
|
this.onMouseLeave = this.onMouseLeave.bind(this);
|
|
@@ -61,7 +62,7 @@ class PaletteContentListItem extends React.Component {
|
|
|
61
62
|
// We cannot use the dataTransfer object for the nodeTemplate because
|
|
62
63
|
// the dataTransfer data is not available during dragOver events so we set
|
|
63
64
|
// the nodeTemplate into the canvas controller.
|
|
64
|
-
this.props.canvasController.
|
|
65
|
+
this.props.canvasController.nodeTemplateDragStart(this.props.nodeTypeInfo.nodeType);
|
|
65
66
|
|
|
66
67
|
// On firefox, the drag will not start unless something is written to
|
|
67
68
|
// the dataTransfer object so just write an empty string
|
|
@@ -72,6 +73,11 @@ class PaletteContentListItem extends React.Component {
|
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
|
|
76
|
+
// This is needed in-case the drag ends somewhere other than the canvas area.
|
|
77
|
+
onDragEnd() {
|
|
78
|
+
this.props.canvasController.nodeTemplateDragEnd();
|
|
79
|
+
}
|
|
80
|
+
|
|
75
81
|
onDoubleClick() {
|
|
76
82
|
if (this.props.canvasController.createAutoNode) {
|
|
77
83
|
this.props.canvasController.createAutoNode(this.props.nodeTypeInfo.nodeType);
|
|
@@ -295,6 +301,7 @@ class PaletteContentListItem extends React.Component {
|
|
|
295
301
|
onMouseLeave={this.onMouseLeave}
|
|
296
302
|
onMouseDown={this.props.isEditingEnabled ? this.onMouseDown : null}
|
|
297
303
|
onDragStart={this.props.isEditingEnabled ? this.onDragStart : null}
|
|
304
|
+
onDragEnd={this.props.isEditingEnabled ? this.onDragEnd : null}
|
|
298
305
|
onDoubleClick={this.props.isEditingEnabled ? this.onDoubleClick : null}
|
|
299
306
|
>
|
|
300
307
|
{categoryLabel}
|
|
@@ -36,6 +36,7 @@ class PaletteDialogContentGridNode extends React.Component {
|
|
|
36
36
|
this.ghostData = null;
|
|
37
37
|
|
|
38
38
|
this.onDragStart = this.onDragStart.bind(this);
|
|
39
|
+
this.onDragEnd = this.onDragEnd.bind(this);
|
|
39
40
|
this.onDoubleClick = this.onDoubleClick.bind(this);
|
|
40
41
|
this.onMouseOver = this.onMouseOver.bind(this);
|
|
41
42
|
this.onMouseLeave = this.onMouseLeave.bind(this);
|
|
@@ -55,7 +56,7 @@ class PaletteDialogContentGridNode extends React.Component {
|
|
|
55
56
|
// We cannot use the dataTransfer object for the nodeTemplate because
|
|
56
57
|
// the dataTransfer data is not available during dragOver events so we set
|
|
57
58
|
// the nodeTemplate into the canvas controller.
|
|
58
|
-
this.props.canvasController.
|
|
59
|
+
this.props.canvasController.nodeTemplateDragStart(this.props.nodeTemplate);
|
|
59
60
|
|
|
60
61
|
// On firefox, the drag will not start unless something is written to
|
|
61
62
|
// the dataTransfer object so just write an empty string
|
|
@@ -66,6 +67,11 @@ class PaletteDialogContentGridNode extends React.Component {
|
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
// This is needed in-case the drag ends somewhere other than the canvas area.
|
|
71
|
+
onDragEnd() {
|
|
72
|
+
this.props.canvasController.nodeTemplateDragEnd();
|
|
73
|
+
}
|
|
74
|
+
|
|
69
75
|
onDoubleClick() {
|
|
70
76
|
if (this.props.canvasController.createAutoNode) {
|
|
71
77
|
this.props.canvasController.createAutoNode(this.props.nodeTemplate);
|
|
@@ -134,6 +140,7 @@ class PaletteDialogContentGridNode extends React.Component {
|
|
|
134
140
|
onMouseLeave={this.onMouseLeave}
|
|
135
141
|
onMouseDown={this.props.isEditingEnabled ? this.onMouseDown : null}
|
|
136
142
|
onDragStart={this.props.isEditingEnabled ? this.onDragStart : null}
|
|
143
|
+
onDragEnd={this.props.isEditingEnabled ? this.onDragEnd : null}
|
|
137
144
|
onDoubleClick={this.props.isEditingEnabled ? this.onDoubleClick : null}
|
|
138
145
|
className="palette-dialog-grid-node-outer"
|
|
139
146
|
>
|
|
@@ -68,7 +68,7 @@ function getOccurrences(nodeType, category, filterStrings) {
|
|
|
68
68
|
// Returns the occurences and hit counts info for the label of the category
|
|
69
69
|
// passed in based on the filterStrings.
|
|
70
70
|
function getCategoryLabelInfo(category, filterStrings) {
|
|
71
|
-
const catLabel = has(category, "label")
|
|
71
|
+
const catLabel = has(category, "label") && category.label
|
|
72
72
|
? category.label.toLowerCase()
|
|
73
73
|
: "";
|
|
74
74
|
const { occurrences, hitCounts } = wordOccurrences(catLabel, filterStrings);
|
|
@@ -78,7 +78,7 @@ function getCategoryLabelInfo(category, filterStrings) {
|
|
|
78
78
|
// Returns the occurences and hit counts info for the label of the node
|
|
79
79
|
// passed in based on the filterStrings.
|
|
80
80
|
function getNodeLabelInfo(nodeType, filterStrings) {
|
|
81
|
-
const nodeLabel = has(nodeType, "app_data.ui_data.label")
|
|
81
|
+
const nodeLabel = has(nodeType, "app_data.ui_data.label") && nodeType.app_data.ui_data.label
|
|
82
82
|
? nodeType.app_data.ui_data.label.toLowerCase()
|
|
83
83
|
: "";
|
|
84
84
|
const { occurrences, hitCounts } = wordOccurrences(nodeLabel, filterStrings);
|
|
@@ -88,7 +88,7 @@ function getNodeLabelInfo(nodeType, filterStrings) {
|
|
|
88
88
|
// Returns the occurences and hit counts info for the description of the node
|
|
89
89
|
// passed in based on the filterStrings.
|
|
90
90
|
function getNodeDescInfo(nodeType, filterStrings) {
|
|
91
|
-
const desc = has(nodeType, "app_data.ui_data.description")
|
|
91
|
+
const desc = has(nodeType, "app_data.ui_data.description") && nodeType.app_data.ui_data.description
|
|
92
92
|
? nodeType.app_data.ui_data.description.toLowerCase()
|
|
93
93
|
: "";
|
|
94
94
|
const { occurrences, hitCounts } = wordOccurrences(desc, filterStrings);
|
|
@@ -18,10 +18,24 @@ import React from "react";
|
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
19
|
|
|
20
20
|
import Tooltip from "../tooltip/tooltip.jsx";
|
|
21
|
-
import
|
|
21
|
+
import ArrangeHorizontally from "./../../assets/images/arrange_horizontally.svg";
|
|
22
|
+
import ArrangeVertically from "./../../assets/images/arrange_vertically.svg";
|
|
23
|
+
import ToggleNotificationPanel from "./../../assets/images/notification_counter_icon.svg";
|
|
24
|
+
import PaletteClose from "./../../assets/images/palette/palette_close.svg";
|
|
25
|
+
import PaletteOpen from "./../../assets/images/palette/palette_open.svg";
|
|
26
|
+
import ZoomToFit from "./../../assets/images/zoom_to_fit.svg";
|
|
27
|
+
|
|
22
28
|
import { Button } from "carbon-components-react";
|
|
23
29
|
import SVG from "react-inlinesvg";
|
|
24
30
|
import classNames from "classnames";
|
|
31
|
+
import { StopFilledAlt16, Play16, Undo16, Redo16, Cut16, Copy16, Paste16,
|
|
32
|
+
AddComment16, TrashCan16, ZoomIn16, ZoomOut16 } from "@carbon/icons-react";
|
|
33
|
+
import { TOOLBAR_STOP, TOOLBAR_RUN, TOOLBAR_UNDO, TOOLBAR_REDO, TOOLBAR_CUT,
|
|
34
|
+
TOOLBAR_COPY, TOOLBAR_PASTE, TOOLBAR_CREATE_AUTO_COMMENT,
|
|
35
|
+
TOOLBAR_DELETE_SELECTED_OBJECTS, TOOLBAR_ZOOM_IN, TOOLBAR_ZOOM_OUT, TOOLBAR_ZOOM_FIT,
|
|
36
|
+
TOOLBAR_ARRANGE_HORIZONALLY, TOOLBAR_ARRANGE_VERTICALLY, TOOLBAR_OPEN_PALETTE,
|
|
37
|
+
TOOLBAR_CLOSE_PALETTE, TOOLBAR_TOGGLE_NOTIFICATION_PANEL }
|
|
38
|
+
from "../common-canvas/constants/canvas-constants.js";
|
|
25
39
|
|
|
26
40
|
class ToolbarActionItem extends React.Component {
|
|
27
41
|
constructor(props) {
|
|
@@ -30,6 +44,55 @@ class ToolbarActionItem extends React.Component {
|
|
|
30
44
|
this.actionClickHandler = this.actionClickHandler.bind(this);
|
|
31
45
|
}
|
|
32
46
|
|
|
47
|
+
// Returns a default icon, if there is one, for the action passed in. The
|
|
48
|
+
// icon may be overridden by the iconTypeOverride field if it is provided.
|
|
49
|
+
// It also may be set to disabled state.
|
|
50
|
+
getDefaultIcon(actionObj) {
|
|
51
|
+
const iconType = actionObj.iconTypeOverride ? actionObj.iconTypeOverride : actionObj.action;
|
|
52
|
+
const disabled = !actionObj.enable;
|
|
53
|
+
|
|
54
|
+
switch (iconType) {
|
|
55
|
+
case (TOOLBAR_STOP):
|
|
56
|
+
return <StopFilledAlt16 disabled={disabled} />;
|
|
57
|
+
case (TOOLBAR_RUN):
|
|
58
|
+
return <Play16 disabled={disabled} />;
|
|
59
|
+
case (TOOLBAR_UNDO):
|
|
60
|
+
return <Undo16 disabled={disabled} />;
|
|
61
|
+
case (TOOLBAR_REDO):
|
|
62
|
+
return <Redo16 disabled={disabled} />;
|
|
63
|
+
case (TOOLBAR_CUT):
|
|
64
|
+
return <Cut16 disabled={disabled} />;
|
|
65
|
+
case (TOOLBAR_COPY):
|
|
66
|
+
return <Copy16 disabled={disabled} />;
|
|
67
|
+
case (TOOLBAR_PASTE):
|
|
68
|
+
return <Paste16 disabled={disabled} />;
|
|
69
|
+
case (TOOLBAR_CREATE_AUTO_COMMENT):
|
|
70
|
+
return <AddComment16 disabled={disabled} />;
|
|
71
|
+
case (TOOLBAR_DELETE_SELECTED_OBJECTS):
|
|
72
|
+
return <TrashCan16 disabled={disabled} />;
|
|
73
|
+
case (TOOLBAR_ZOOM_IN):
|
|
74
|
+
return <ZoomIn16 disabled={disabled} />;
|
|
75
|
+
case (TOOLBAR_ZOOM_OUT):
|
|
76
|
+
return <ZoomOut16 disabled={disabled} />;
|
|
77
|
+
|
|
78
|
+
case (TOOLBAR_ZOOM_FIT):
|
|
79
|
+
return <SVG src={ZoomToFit} disabled={disabled} />;
|
|
80
|
+
case (TOOLBAR_ARRANGE_HORIZONALLY):
|
|
81
|
+
return <SVG src={ArrangeVertically} disabled={disabled} />;
|
|
82
|
+
case (TOOLBAR_ARRANGE_VERTICALLY):
|
|
83
|
+
return <SVG src={ArrangeHorizontally} disabled={disabled} />;
|
|
84
|
+
case (TOOLBAR_OPEN_PALETTE):
|
|
85
|
+
return <SVG src={PaletteOpen} disabled={disabled} />;
|
|
86
|
+
case (TOOLBAR_CLOSE_PALETTE):
|
|
87
|
+
return <SVG src={PaletteClose} disabled={disabled} />;
|
|
88
|
+
case (TOOLBAR_TOGGLE_NOTIFICATION_PANEL):
|
|
89
|
+
return <SVG src={ToggleNotificationPanel} disabled={disabled} />;
|
|
90
|
+
|
|
91
|
+
default:
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
33
96
|
generateLabel(label, disable, overflow, incLabelWithIcon) {
|
|
34
97
|
let className = "toolbar-icon-label";
|
|
35
98
|
className += this.generateLabelType(overflow, incLabelWithIcon);
|
|
@@ -49,10 +112,9 @@ class ToolbarActionItem extends React.Component {
|
|
|
49
112
|
}
|
|
50
113
|
|
|
51
114
|
generateIcon(actionObj) {
|
|
52
|
-
|
|
53
|
-
let icon = <Icon type={iconType} disabled={!actionObj.enable} noAddedClasses />;
|
|
115
|
+
let icon = this.getDefaultIcon(actionObj);
|
|
54
116
|
|
|
55
|
-
// Host application provided icon.
|
|
117
|
+
// Host application provided icon. This will override any default icon.
|
|
56
118
|
if (actionObj.iconEnabled) {
|
|
57
119
|
const iconEnabled = actionObj.iconEnabled;
|
|
58
120
|
const iconDisabled = actionObj.iconDisabled || actionObj.iconEnabled;
|
|
@@ -66,13 +128,14 @@ class ToolbarActionItem extends React.Component {
|
|
|
66
128
|
}
|
|
67
129
|
}
|
|
68
130
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
131
|
+
if (icon) {
|
|
132
|
+
return (
|
|
133
|
+
<div className={"toolbar-icon"}>
|
|
134
|
+
{icon}
|
|
135
|
+
</div>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
76
139
|
}
|
|
77
140
|
|
|
78
141
|
actionClickHandler() {
|
|
@@ -98,6 +161,7 @@ class ToolbarActionItem extends React.Component {
|
|
|
98
161
|
|
|
99
162
|
const itemContentClassName = classNames(
|
|
100
163
|
"toolbar-item-content",
|
|
164
|
+
actionObj.className ? actionObj.className : null,
|
|
101
165
|
{ "overflow": this.props.overflow, "disabled": !actionObj.enable, "default": !actionObj.kind });
|
|
102
166
|
|
|
103
167
|
// If no 'kind' is set, use ghost and then override colors using the "default" class in innerDivClassName.
|
|
@@ -153,9 +217,8 @@ class ToolbarActionItem extends React.Component {
|
|
|
153
217
|
// toolbar next to the icon (i.e. incLabelWithIcon is set to something).
|
|
154
218
|
showLabelAsTip(actionObj) {
|
|
155
219
|
if (actionObj.label) {
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
actionObj.incLabelWithIcon === "after")) {
|
|
220
|
+
if (actionObj.incLabelWithIcon === "before" ||
|
|
221
|
+
actionObj.incLabelWithIcon === "after") {
|
|
159
222
|
return false;
|
|
160
223
|
}
|
|
161
224
|
return true;
|
|
@@ -17,9 +17,8 @@
|
|
|
17
17
|
import React from "react";
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
19
|
|
|
20
|
-
import Icon from "../icons/icon.jsx";
|
|
21
20
|
import { Button } from "carbon-components-react";
|
|
22
|
-
import {
|
|
21
|
+
import { OverflowMenuVertical16 } from "@carbon/icons-react";
|
|
23
22
|
|
|
24
23
|
class ToolbarOverflowItem extends React.Component {
|
|
25
24
|
constructor(props) {
|
|
@@ -56,7 +55,7 @@ class ToolbarOverflowItem extends React.Component {
|
|
|
56
55
|
>
|
|
57
56
|
<div className="toolbar-item-content default">
|
|
58
57
|
<div className="toolbar-icon">
|
|
59
|
-
<
|
|
58
|
+
<OverflowMenuVertical16 />
|
|
60
59
|
</div>
|
|
61
60
|
</div>
|
|
62
61
|
</Button>
|
package/src/tooltip/tooltip.jsx
CHANGED
|
@@ -175,7 +175,10 @@ class ToolTip extends React.Component {
|
|
|
175
175
|
tooltip.style.left = this.getStyleValue(viewPortWidth - tooltip.offsetWidth); // hitting right border
|
|
176
176
|
}
|
|
177
177
|
} else if (tooltipDirection === "left") {
|
|
178
|
-
tooltip.
|
|
178
|
+
// For long tooltips, tooltip.offsetWidth is updated after setting tooltip.style.left. Ensure tooltip doesn't overlap tooltipTrigger element.
|
|
179
|
+
while ((tooltip.offsetLeft + tooltip.offsetWidth + pointerLayout.width) > triggerLayout.left) {
|
|
180
|
+
tooltip.style.left = this.getStyleValue(triggerLayout.left - tooltip.offsetWidth - pointerLayout.width);
|
|
181
|
+
}
|
|
179
182
|
} else if (tooltipDirection === "right") {
|
|
180
183
|
tooltip.style.left = this.getStyleValue(triggerLayout.right + pointerLayout.width);
|
|
181
184
|
}
|