@elyra/canvas 12.12.3 → 12.13.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/.stylelintrc.json +17 -16
- package/README.md +1 -1
- package/dist/{canvas-controller-e91d037b.js → canvas-controller-40beba7d.js} +1 -1
- package/dist/{canvas-controller-e91d037b.js.map → canvas-controller-40beba7d.js.map} +1 -1
- package/dist/{canvas-controller-de76a796.js → canvas-controller-f62a8ef7.js} +1 -1
- package/dist/{canvas-controller-de76a796.js.map → canvas-controller-f62a8ef7.js.map} +1 -1
- package/dist/common-canvas-f0f1afd7.js +2 -0
- package/dist/common-canvas-f0f1afd7.js.map +1 -0
- package/dist/common-canvas-feb8cd7a.js +2 -0
- package/dist/common-canvas-feb8cd7a.js.map +1 -0
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/common-properties-1d4c875b.js +2 -0
- package/dist/common-properties-1d4c875b.js.map +1 -0
- package/dist/common-properties-da3999f5.js +2 -0
- package/dist/common-properties-da3999f5.js.map +1 -0
- package/dist/{extends-7fdcdc52.js → extends-1139e06f.js} +2 -2
- package/dist/{extends-7fdcdc52.js.map → extends-1139e06f.js.map} +1 -1
- package/dist/{flexible-table-50ce600a.js → flexible-table-b31e92b8.js} +2 -2
- package/dist/flexible-table-b31e92b8.js.map +1 -0
- package/dist/{flexible-table-a13cb7d0.js → flexible-table-f88dfef1.js} +2 -2
- package/dist/flexible-table-f88dfef1.js.map +1 -0
- package/dist/{icon-bf77b2aa.js → icon-918d2dd3.js} +2 -2
- package/dist/{icon-bf77b2aa.js.map → icon-918d2dd3.js.map} +1 -1
- package/dist/{index-f2c306ba.js → index-b6f098b8.js} +2 -2
- package/dist/{index-f2c306ba.js.map → index-b6f098b8.js.map} +1 -1
- package/dist/{index-0e6c8b9c.js → index-f44d40bc.js} +2 -2
- package/dist/{index-0e6c8b9c.js.map → index-f44d40bc.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/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-c6fa3cdb.js → toolbar-2baadd0f.js} +2 -2
- package/dist/{toolbar-c6fa3cdb.js.map → toolbar-2baadd0f.js.map} +1 -1
- package/dist/{toolbar-1c181339.js → toolbar-d07d4d8a.js} +1 -1
- package/dist/{toolbar-1c181339.js.map → toolbar-d07d4d8a.js.map} +1 -1
- package/locales/command-actions/locales/de.json +50 -8
- package/locales/command-actions/locales/en.json +1 -1
- package/locales/command-actions/locales/es.json +50 -8
- package/locales/command-actions/locales/fr.json +50 -8
- package/locales/command-actions/locales/index.js +2 -2
- package/locales/command-actions/locales/it.json +50 -8
- package/locales/command-actions/locales/ja.json +50 -8
- package/locales/command-actions/locales/ko.json +42 -0
- package/locales/command-actions/locales/pt-br.json +50 -8
- package/locales/command-actions/locales/zh-CN.json +51 -0
- package/locales/command-actions/locales/zh-TW.json +51 -0
- package/locales/common-canvas/locales/de.json +36 -26
- package/locales/common-canvas/locales/en.json +1 -1
- package/locales/common-canvas/locales/es.json +36 -26
- package/locales/common-canvas/locales/fr.json +36 -26
- package/locales/common-canvas/locales/index.js +2 -2
- package/locales/common-canvas/locales/it.json +36 -26
- package/locales/common-canvas/locales/ja.json +36 -26
- package/locales/common-canvas/locales/ko.json +7 -2
- package/locales/common-canvas/locales/pt-br.json +36 -26
- package/locales/common-canvas/locales/zh-CN.json +37 -0
- package/locales/common-canvas/locales/zh-TW.json +37 -0
- package/locales/common-properties/locales/de.json +92 -92
- package/locales/common-properties/locales/en.json +1 -1
- package/locales/common-properties/locales/es.json +92 -92
- package/locales/common-properties/locales/fr.json +92 -92
- package/locales/common-properties/locales/index.js +2 -2
- package/locales/common-properties/locales/it.json +92 -92
- package/locales/common-properties/locales/ja.json +92 -92
- package/locales/common-properties/locales/ko.json +1 -1
- package/locales/common-properties/locales/pt-br.json +92 -92
- package/locales/common-properties/locales/zh-CN.json +93 -0
- package/locales/common-properties/locales/zh-TW.json +93 -0
- package/locales/palette/locales/de.json +9 -9
- package/locales/palette/locales/en.json +6 -6
- package/locales/palette/locales/es.json +9 -9
- package/locales/palette/locales/fr.json +9 -9
- package/locales/palette/locales/index.js +2 -2
- package/locales/palette/locales/it.json +9 -9
- package/locales/palette/locales/ja.json +9 -9
- package/locales/palette/locales/pt-br.json +9 -9
- package/locales/palette/locales/zh-CN.json +10 -0
- package/locales/palette/locales/zh-TW.json +10 -0
- package/locales/toolbar/locales/de.json +7 -7
- package/locales/toolbar/locales/en.json +1 -1
- package/locales/toolbar/locales/es.json +7 -7
- package/locales/toolbar/locales/fr.json +7 -7
- package/locales/toolbar/locales/index.js +2 -2
- package/locales/toolbar/locales/it.json +7 -7
- package/locales/toolbar/locales/ja.json +7 -7
- package/locales/toolbar/locales/pt-br.json +7 -7
- package/locales/toolbar/locales/zh-CN.json +8 -0
- package/locales/toolbar/locales/zh-TW.json +8 -0
- package/package.json +2 -2
- package/src/common-canvas/canvas-controller.js +2 -2
- package/src/common-canvas/cc-contents.jsx +0 -3
- package/src/common-canvas/common-canvas.scss +4 -2
- package/src/common-properties/components/flexible-table/flexible-table.jsx +14 -3
- package/src/common-properties/components/flexible-table/flexible-table.scss +20 -0
- package/src/common-properties/controls/abstract-table.jsx +2 -0
- package/src/common-properties/controls/list/list.jsx +1 -0
- package/src/common-properties/controls/selectcolumns/selectcolumns.jsx +1 -0
- package/src/common-properties/controls/someofselect/someofselect.jsx +1 -0
- package/src/common-properties/form/EditorForm.js +21 -3
- package/src/common-properties/panels/action-panel/action-panel.jsx +38 -3
- package/src/common-properties/panels/action-panel/action-panel.scss +3 -0
- package/src/common-properties/panels/text-panel/text-panel.jsx +38 -7
- package/src/common-properties/panels/text-panel/text-panel.scss +4 -3
- package/src/common-properties/properties-controller.js +16 -2
- package/src/common-properties/ui-conditions/conditions-utils.js +14 -8
- package/src/palette/palette-content-list-item.jsx +12 -2
- package/src/palette/palette-content-list.jsx +11 -19
- package/src/palette/palette-dialog-content-grid.jsx +1 -6
- package/src/palette/palette-dialog-content.jsx +13 -11
- package/src/palette/palette-flyout-content-category.jsx +26 -24
- package/src/palette/palette-flyout-content.jsx +4 -24
- package/src/palette/palette.scss +71 -43
- package/src/tooltip/tooltip.jsx +1 -1
- package/stats.html +1 -1
- package/dist/common-canvas-522f6263.js +0 -2
- package/dist/common-canvas-522f6263.js.map +0 -1
- package/dist/common-canvas-90539c97.js +0 -2
- package/dist/common-canvas-90539c97.js.map +0 -1
- package/dist/common-properties-245c4711.js +0 -2
- package/dist/common-properties-245c4711.js.map +0 -1
- package/dist/common-properties-49e6bb67.js +0 -2
- package/dist/common-properties-49e6bb67.js.map +0 -1
- package/dist/flexible-table-50ce600a.js.map +0 -1
- package/dist/flexible-table-a13cb7d0.js.map +0 -1
- package/locales/command-actions/locales/zh-cn.json +0 -9
- package/locales/command-actions/locales/zh-tw.json +0 -9
- package/locales/common-canvas/locales/zh-cn.json +0 -27
- package/locales/common-canvas/locales/zh-tw.json +0 -27
- package/locales/common-properties/locales/zh-cn.json +0 -93
- package/locales/common-properties/locales/zh-tw.json +0 -93
- package/locales/palette/locales/zh-cn.json +0 -10
- package/locales/palette/locales/zh-tw.json +0 -10
- package/locales/toolbar/locales/zh-cn.json +0 -8
- package/locales/toolbar/locales/zh-tw.json +0 -8
|
@@ -88,7 +88,7 @@ class ControlPanel {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
class ActionPanel {
|
|
91
|
-
constructor(id, panelType, className, nestedPanel, actions) {
|
|
91
|
+
constructor(id, panelType, className, nestedPanel, actions, label, description) {
|
|
92
92
|
this.id = id;
|
|
93
93
|
this.panelType = panelType;
|
|
94
94
|
this.nestedPanel = nestedPanel;
|
|
@@ -96,6 +96,12 @@ class ActionPanel {
|
|
|
96
96
|
if (className) {
|
|
97
97
|
this.className = className;
|
|
98
98
|
}
|
|
99
|
+
if (label) {
|
|
100
|
+
this.label = label;
|
|
101
|
+
}
|
|
102
|
+
if (description) {
|
|
103
|
+
this.description = description;
|
|
104
|
+
}
|
|
99
105
|
}
|
|
100
106
|
}
|
|
101
107
|
|
|
@@ -201,12 +207,24 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
|
|
|
201
207
|
return UIItem.makePanel(new ControlPanel(groupName, PanelType.SUMMARY, groupClassName, nestedPanel, panSubItems, groupLabel));
|
|
202
208
|
}
|
|
203
209
|
case GroupType.ACTION_PANEL: {
|
|
210
|
+
groupLabel = l10nProvider.l10nResource(group.label);
|
|
211
|
+
let groupDesc;
|
|
212
|
+
if (group.description) {
|
|
213
|
+
groupDesc = new Description(l10nProvider.l10nResource(group.description),
|
|
214
|
+
null,
|
|
215
|
+
group.description ? group.description.link : null);
|
|
216
|
+
}
|
|
204
217
|
return UIItem.makePanel(new ActionPanel(groupName, PanelType.ACTION_PANEL, groupClassName, nestedPanel,
|
|
205
|
-
_makeActions(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider)));
|
|
218
|
+
_makeActions(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider), groupLabel, groupDesc));
|
|
206
219
|
}
|
|
207
220
|
case GroupType.TEXT_PANEL: {
|
|
208
221
|
groupLabel = l10nProvider.l10nResource(group.label);
|
|
209
|
-
|
|
222
|
+
let groupDesc;
|
|
223
|
+
if (group.description) {
|
|
224
|
+
groupDesc = new Description(l10nProvider.l10nResource(group.description),
|
|
225
|
+
group.description ? group.description.placement : null,
|
|
226
|
+
group.description ? group.description.link : null);
|
|
227
|
+
}
|
|
210
228
|
return UIItem.makeTextPanel(groupName, groupLabel, groupDesc, groupClassName, nestedPanel);
|
|
211
229
|
}
|
|
212
230
|
case GroupType.TWISTY_PANEL: {
|
|
@@ -19,22 +19,57 @@ import PropTypes from "prop-types";
|
|
|
19
19
|
import { connect } from "react-redux";
|
|
20
20
|
import classNames from "classnames";
|
|
21
21
|
import * as ControlUtils from "./../../util/control-utils";
|
|
22
|
-
import { STATES } from "./../../constants/constants";
|
|
22
|
+
import { STATES, CARBON_ICONS } from "./../../constants/constants";
|
|
23
|
+
import { evaluateText } from "./../../util/property-utils.js";
|
|
24
|
+
import Tooltip from "./../../../tooltip/tooltip.jsx";
|
|
25
|
+
import Icon from "./../../../icons/icon.jsx";
|
|
26
|
+
import { isEmpty } from "lodash";
|
|
23
27
|
|
|
24
28
|
class ActionPanel extends Component {
|
|
25
29
|
render() {
|
|
26
30
|
const className = this.props.panel.className ? this.props.panel.className : "";
|
|
31
|
+
const hidden = this.props.panelState === STATES.HIDDEN;
|
|
32
|
+
const disabled = this.props.panelState === STATES.DISABLED;
|
|
33
|
+
let label;
|
|
34
|
+
if (this.props.panel.label) {
|
|
35
|
+
let tooltip;
|
|
36
|
+
if (this.props.panel.description && !isEmpty(this.props.panel.description.text)) {
|
|
37
|
+
const dynamicDescriptionText = evaluateText(this.props.panel.description.text, this.props.controller);
|
|
38
|
+
// If tooltip has a link, add propertyId in the link object
|
|
39
|
+
if (this.props.panel.description.link) {
|
|
40
|
+
this.props.panel.description.link.propertyId = { name: this.props.panel.id };
|
|
41
|
+
}
|
|
42
|
+
tooltip = (<Tooltip
|
|
43
|
+
id={`tooltip-label-${this.props.panel.id}`}
|
|
44
|
+
tip={dynamicDescriptionText}
|
|
45
|
+
link={this.props.panel.description.link ? this.props.panel.description.link : null}
|
|
46
|
+
tooltipLinkHandler={this.props.controller.getHandlers().tooltipLinkHandler}
|
|
47
|
+
direction="bottom"
|
|
48
|
+
disable={hidden || disabled}
|
|
49
|
+
showToolTipOnClick
|
|
50
|
+
>
|
|
51
|
+
<Icon type={CARBON_ICONS.INFORMATION} className="properties-control-description-icon-info" />
|
|
52
|
+
</Tooltip>);
|
|
53
|
+
}
|
|
54
|
+
label = (
|
|
55
|
+
<div className={classNames("properties-label-container")}>
|
|
56
|
+
<label className="properties-control-label">{this.props.panel.label}</label>
|
|
57
|
+
{tooltip}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
27
61
|
return (
|
|
28
62
|
<div
|
|
29
63
|
className={classNames(
|
|
30
64
|
"properties-action-panel",
|
|
31
|
-
{ "hide":
|
|
65
|
+
{ "hide": hidden },
|
|
32
66
|
{ "properties-control-nested-panel": this.props.panel.nestedPanel },
|
|
33
67
|
className
|
|
34
68
|
)}
|
|
35
69
|
data-id={ControlUtils.getDataId({ name: this.props.panel.id })}
|
|
36
|
-
disabled={
|
|
70
|
+
disabled={disabled}
|
|
37
71
|
>
|
|
72
|
+
{label}
|
|
38
73
|
{this.props.children}
|
|
39
74
|
</div>);
|
|
40
75
|
}
|
|
@@ -19,24 +19,55 @@ import PropTypes from "prop-types";
|
|
|
19
19
|
import { connect } from "react-redux";
|
|
20
20
|
import { evaluateText } from "./../../util/property-utils.js";
|
|
21
21
|
import classNames from "classnames";
|
|
22
|
-
import { STATES } from "./../../constants/constants";
|
|
22
|
+
import { STATES, CARBON_ICONS } from "./../../constants/constants";
|
|
23
|
+
import { isEmpty } from "lodash";
|
|
24
|
+
import Tooltip from "./../../../tooltip/tooltip.jsx";
|
|
25
|
+
import Icon from "./../../../icons/icon.jsx";
|
|
23
26
|
|
|
24
27
|
class TextPanel extends Component {
|
|
25
28
|
render() {
|
|
26
29
|
const className = this.props.panel.className ? this.props.panel.className : "";
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
const hidden = this.props.panelState === STATES.HIDDEN;
|
|
31
|
+
const disabled = this.props.panelState === STATES.DISABLED;
|
|
32
|
+
let label = this.props.panel.label ? (<div className="panel-label">{this.props.panel.label}</div>) : null;
|
|
33
|
+
let description;
|
|
34
|
+
if (this.props.panel.description && !isEmpty(this.props.panel.description.text)) {
|
|
35
|
+
const dynamicDescriptionText = evaluateText(this.props.panel.description.text, this.props.controller);
|
|
36
|
+
if (this.props.panel.description.placement === "as_tooltip") {
|
|
37
|
+
// If tooltip has a link, add propertyId in the link object
|
|
38
|
+
if (this.props.panel.description.link) {
|
|
39
|
+
this.props.panel.description.link.propertyId = { name: this.props.panel.id };
|
|
40
|
+
}
|
|
41
|
+
const tooltip = (<Tooltip
|
|
42
|
+
id={`tooltip-label-${this.props.panel.id}`}
|
|
43
|
+
tip={dynamicDescriptionText}
|
|
44
|
+
link={this.props.panel.description.link ? this.props.panel.description.link : null}
|
|
45
|
+
tooltipLinkHandler={this.props.controller.getHandlers().tooltipLinkHandler}
|
|
46
|
+
direction="bottom"
|
|
47
|
+
disable={hidden || disabled}
|
|
48
|
+
showToolTipOnClick
|
|
49
|
+
>
|
|
50
|
+
<Icon type={CARBON_ICONS.INFORMATION} className="properties-control-description-icon-info" />
|
|
51
|
+
</Tooltip>);
|
|
52
|
+
label = (
|
|
53
|
+
<div className={classNames("properties-label-container")}>
|
|
54
|
+
{label}
|
|
55
|
+
{tooltip}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
} else {
|
|
59
|
+
description = <div className="panel-description">{dynamicDescriptionText}</div>;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
31
62
|
return (
|
|
32
63
|
<div
|
|
33
64
|
className={classNames(
|
|
34
65
|
"properties-text-panel",
|
|
35
|
-
{ "hide":
|
|
66
|
+
{ "hide": hidden },
|
|
36
67
|
{ "properties-control-nested-panel": this.props.panel.nestedPanel },
|
|
37
68
|
className
|
|
38
69
|
)}
|
|
39
|
-
disabled={
|
|
70
|
+
disabled={disabled}
|
|
40
71
|
>
|
|
41
72
|
{label}
|
|
42
73
|
{description}
|
|
@@ -15,9 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
.properties-text-panel {
|
|
18
|
-
:not(:empty) {
|
|
19
|
-
padding-bottom: $spacing-05;
|
|
20
|
-
}
|
|
21
18
|
.panel-label {
|
|
22
19
|
@include carbon--type-style("productive-heading-01");
|
|
23
20
|
color: $text-01;
|
|
@@ -26,6 +23,10 @@
|
|
|
26
23
|
.panel-description {
|
|
27
24
|
@include carbon--type-style("body-short-01");
|
|
28
25
|
color: $text-01;
|
|
26
|
+
padding-bottom: $spacing-05;
|
|
27
|
+
}
|
|
28
|
+
.tooltip-container {
|
|
29
|
+
margin-bottom: $spacing-03;
|
|
29
30
|
}
|
|
30
31
|
&[disabled] {
|
|
31
32
|
opacity: 0.5;
|
|
@@ -1346,7 +1346,8 @@ export default class PropertiesController {
|
|
|
1346
1346
|
// don't return hidden message
|
|
1347
1347
|
if (filterHiddenDisable) {
|
|
1348
1348
|
const controlState = this.getControlState(propertyId);
|
|
1349
|
-
|
|
1349
|
+
const controlType = this.getControlType(propertyId);
|
|
1350
|
+
if (controlState === STATES.DISABLED || controlState === STATES.HIDDEN || controlType === ControlType.HIDDEN) {
|
|
1350
1351
|
return null;
|
|
1351
1352
|
}
|
|
1352
1353
|
}
|
|
@@ -1444,7 +1445,8 @@ export default class PropertiesController {
|
|
|
1444
1445
|
_filterHiddenDisabledErrors(messages) {
|
|
1445
1446
|
const filterCondition = (testMessage, propertyId) => {
|
|
1446
1447
|
const controlState = this.getControlState(propertyId);
|
|
1447
|
-
|
|
1448
|
+
const controlType = this.getControlType(propertyId);
|
|
1449
|
+
return controlState !== STATES.HIDDEN && controlState !== STATES.DISABLED && controlType !== ControlType.HIDDEN;
|
|
1448
1450
|
};
|
|
1449
1451
|
const filteredMessages = this._filterErrors(messages, filterCondition);
|
|
1450
1452
|
return filteredMessages;
|
|
@@ -1632,6 +1634,9 @@ export default class PropertiesController {
|
|
|
1632
1634
|
}
|
|
1633
1635
|
|
|
1634
1636
|
getControlType(propertyId) {
|
|
1637
|
+
if (typeof propertyId === "undefined") {
|
|
1638
|
+
return null;
|
|
1639
|
+
}
|
|
1635
1640
|
const control = this.getControl(propertyId);
|
|
1636
1641
|
if (control) {
|
|
1637
1642
|
return control.controlType;
|
|
@@ -1639,6 +1644,15 @@ export default class PropertiesController {
|
|
|
1639
1644
|
return null;
|
|
1640
1645
|
}
|
|
1641
1646
|
|
|
1647
|
+
// check if given column is visible in the table
|
|
1648
|
+
getColumnVisibility(propertyId, columnIndex) {
|
|
1649
|
+
return this.controls[propertyId.name][columnIndex].visible;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
toggleColumnVisibility(propertyId, columnIndex, value) {
|
|
1653
|
+
this.controls[propertyId.name][columnIndex].visible = value;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1642
1656
|
/*
|
|
1643
1657
|
* Summary Panel controls Methods
|
|
1644
1658
|
*/
|
|
@@ -423,7 +423,7 @@ function updatePanelChildrenStatesForPanelIds(panelIds, controller) {
|
|
|
423
423
|
* @param {object} propertyId. required.
|
|
424
424
|
* @param {string} proposed new state value. required.
|
|
425
425
|
*/
|
|
426
|
-
function updateState(refState, propertyId, value) {
|
|
426
|
+
function updateState(refState, propertyId, value, controller) {
|
|
427
427
|
let propState = refState[propertyId.name];
|
|
428
428
|
if (!propState) {
|
|
429
429
|
propState = {};
|
|
@@ -452,6 +452,12 @@ function updateState(refState, propertyId, value) {
|
|
|
452
452
|
} else {
|
|
453
453
|
// Table column level
|
|
454
454
|
propState[colId].value = newPropState.value;
|
|
455
|
+
// if all cells are "hidden", hide an entire column
|
|
456
|
+
const hideColumn = (value === "hidden");
|
|
457
|
+
const updateColumnVisibility = controller.getColumnVisibility(propertyId, propertyId.col) !== !hideColumn;
|
|
458
|
+
if (typeof controller !== "undefined" && updateColumnVisibility) {
|
|
459
|
+
controller.toggleColumnVisibility(propertyId, propertyId.col, !hideColumn);
|
|
460
|
+
}
|
|
455
461
|
}
|
|
456
462
|
} else {
|
|
457
463
|
// Control level
|
|
@@ -841,10 +847,10 @@ function _updateRefsState(stateOn, definition, propertyId, newStates, controller
|
|
|
841
847
|
}
|
|
842
848
|
} else if (stateOn === true) { // control|panel should be visible || enabled
|
|
843
849
|
if (referenceId && currentState !== newOnState && currentState !== notAllowedState) {
|
|
844
|
-
updateState(refStates, referenceId, newOnState);
|
|
850
|
+
updateState(refStates, referenceId, newOnState, controller);
|
|
845
851
|
}
|
|
846
852
|
} else if (referenceId && (visibleControl || (!visibleControl && currentState !== notAllowedState))) {
|
|
847
|
-
_updateStateIfPanel(newStates, referenceId, newOffState, refStates);
|
|
853
|
+
_updateStateIfPanel(newStates, referenceId, newOffState, refStates, controller);
|
|
848
854
|
}
|
|
849
855
|
}
|
|
850
856
|
}
|
|
@@ -975,7 +981,7 @@ function _updateStateIfParent(newStates, panel, state, controller, referenceId)
|
|
|
975
981
|
}
|
|
976
982
|
|
|
977
983
|
// A control can only set a state to enabled if it was previously disabled. The same applies to hidden and visible
|
|
978
|
-
function _updateStateIfPanel(newStates, referenceId, state, refStates) {
|
|
984
|
+
function _updateStateIfPanel(newStates, referenceId, state, refStates, controller) {
|
|
979
985
|
const controlName = referenceId.name;
|
|
980
986
|
if (refStates[controlName]) {
|
|
981
987
|
let prevValue = refStates[controlName].value;
|
|
@@ -985,10 +991,10 @@ function _updateStateIfPanel(newStates, referenceId, state, refStates) {
|
|
|
985
991
|
if (typeof referenceId.row !== "undefined" && refStates[controlName][referenceId.col][referenceId.row]) {
|
|
986
992
|
prevValue = refStates[controlName][referenceId.col][referenceId.row].value;
|
|
987
993
|
} else { // first time setting control state for each row in the column
|
|
988
|
-
updateState(refStates, referenceId, state);
|
|
994
|
+
updateState(refStates, referenceId, state, controller);
|
|
989
995
|
}
|
|
990
996
|
} else { // first time setting control state for the column
|
|
991
|
-
updateState(refStates, referenceId, state);
|
|
997
|
+
updateState(refStates, referenceId, state, controller);
|
|
992
998
|
}
|
|
993
999
|
}
|
|
994
1000
|
// Can only set a state to enabled if it was previously disabled. The same applies to hidden and visible
|
|
@@ -996,10 +1002,10 @@ function _updateStateIfPanel(newStates, referenceId, state, refStates) {
|
|
|
996
1002
|
(prevValue === STATES.DISABLED && state === STATES.ENABLED) ||
|
|
997
1003
|
(prevValue === STATES.DISABLED && state === STATES.HIDDEN) ||
|
|
998
1004
|
(prevValue === STATES.HIDDEN && state === STATES.VISIBLE)) {
|
|
999
|
-
updateState(refStates, referenceId, state);
|
|
1005
|
+
updateState(refStates, referenceId, state, controller);
|
|
1000
1006
|
}
|
|
1001
1007
|
} else { // first time setting control state
|
|
1002
|
-
updateState(refStates, referenceId, state);
|
|
1008
|
+
updateState(refStates, referenceId, state, controller);
|
|
1003
1009
|
}
|
|
1004
1010
|
}
|
|
1005
1011
|
|
|
@@ -47,6 +47,7 @@ class PaletteContentListItem extends React.Component {
|
|
|
47
47
|
this.onMouseOver = this.onMouseOver.bind(this);
|
|
48
48
|
this.onMouseLeave = this.onMouseLeave.bind(this);
|
|
49
49
|
this.onMouseDown = this.onMouseDown.bind(this);
|
|
50
|
+
this.onKeyPress = this.onKeyPress.bind(this);
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
onMouseDown() {
|
|
@@ -73,6 +74,13 @@ class PaletteContentListItem extends React.Component {
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
onKeyPress(e) {
|
|
78
|
+
// e.key === " " is needed to allow Cypress test in palette.js to run on the build machine!
|
|
79
|
+
if (e.key === " " || e.code === "Space" || e.keyCode === 32) {
|
|
80
|
+
this.onDoubleClick();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
76
84
|
// This is needed in-case the drag ends somewhere other than the canvas area.
|
|
77
85
|
onDragEnd() {
|
|
78
86
|
this.props.canvasController.nodeTemplateDragEnd();
|
|
@@ -289,23 +297,25 @@ class PaletteContentListItem extends React.Component {
|
|
|
289
297
|
: null;
|
|
290
298
|
|
|
291
299
|
const nodeLabel = itemText
|
|
292
|
-
? <div className="palette-list-item-text-div">{itemText}</div>
|
|
300
|
+
? <div className="palette-list-item-text-div" tabIndex="-1">{itemText}</div>
|
|
293
301
|
: null;
|
|
294
302
|
|
|
295
303
|
return (
|
|
296
304
|
<div id={this.props.nodeTypeInfo.nodeType.id}
|
|
297
305
|
data-id={this.props.nodeTypeInfo.nodeType.op}
|
|
306
|
+
tabIndex={0}
|
|
298
307
|
draggable={draggable}
|
|
299
308
|
className={mainDivClass}
|
|
300
309
|
onMouseOver={this.onMouseOver}
|
|
301
310
|
onMouseLeave={this.onMouseLeave}
|
|
311
|
+
onKeyPress={this.props.isEditingEnabled ? this.onKeyPress : null}
|
|
302
312
|
onMouseDown={this.props.isEditingEnabled ? this.onMouseDown : null}
|
|
303
313
|
onDragStart={this.props.isEditingEnabled ? this.onDragStart : null}
|
|
304
314
|
onDragEnd={this.props.isEditingEnabled ? this.onDragEnd : null}
|
|
305
315
|
onDoubleClick={this.props.isEditingEnabled ? this.onDoubleClick : null}
|
|
306
316
|
>
|
|
307
317
|
{categoryLabel}
|
|
308
|
-
<div className="palette-list-item-icon-and-text">
|
|
318
|
+
<div className="palette-list-item-icon-and-text" tabIndex="-1">
|
|
309
319
|
{icon}
|
|
310
320
|
{nodeLabel}
|
|
311
321
|
{ranking}
|
|
@@ -38,6 +38,7 @@ class PaletteContentList extends React.Component {
|
|
|
38
38
|
isDisplaySearchResult={false}
|
|
39
39
|
canvasController={this.props.canvasController}
|
|
40
40
|
isPaletteOpen={this.props.isPaletteOpen}
|
|
41
|
+
isEditingEnabled={this.props.isEditingEnabled}
|
|
41
42
|
/>
|
|
42
43
|
</div>
|
|
43
44
|
);
|
|
@@ -46,27 +47,20 @@ class PaletteContentList extends React.Component {
|
|
|
46
47
|
var itemKey = "item_" + idx;
|
|
47
48
|
|
|
48
49
|
contentItems.push(
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</div>
|
|
50
|
+
<PaletteContentListItem
|
|
51
|
+
key={itemKey}
|
|
52
|
+
nodeTypeInfo={this.props.nodeTypeInfos[idx]}
|
|
53
|
+
isDisplaySearchResult={false}
|
|
54
|
+
canvasController={this.props.canvasController}
|
|
55
|
+
isPaletteOpen={this.props.isPaletteOpen}
|
|
56
|
+
isEditingEnabled={this.props.isEditingEnabled}
|
|
57
|
+
/>
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const style = {};
|
|
63
|
-
style.borderBottom = this.props.isLastCategory ? "none" : null;
|
|
64
|
-
style.display = this.props.show ? "block" : "none";
|
|
65
|
-
|
|
66
62
|
return (
|
|
67
|
-
<div width="100%" draggable="false" className="palette-content-list palette-scroll"
|
|
68
|
-
style={ style }
|
|
69
|
-
>
|
|
63
|
+
<div width="100%" draggable="false" className="palette-content-list palette-scroll">
|
|
70
64
|
{contentItems}
|
|
71
65
|
</div>
|
|
72
66
|
);
|
|
@@ -76,11 +70,9 @@ class PaletteContentList extends React.Component {
|
|
|
76
70
|
PaletteContentList.propTypes = {
|
|
77
71
|
category: PropTypes.object.isRequired,
|
|
78
72
|
nodeTypeInfos: PropTypes.array.isRequired,
|
|
79
|
-
show: PropTypes.bool.isRequired,
|
|
80
73
|
canvasController: PropTypes.object.isRequired,
|
|
81
74
|
isPaletteOpen: PropTypes.bool.isRequired,
|
|
82
|
-
|
|
83
|
-
isEditingEnabled: PropTypes.bool.isRequired
|
|
75
|
+
isEditingEnabled: PropTypes.bool.isRequired,
|
|
84
76
|
};
|
|
85
77
|
|
|
86
78
|
export default PaletteContentList;
|
|
@@ -53,12 +53,8 @@ class PaletteDialogContentGrid extends React.Component {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const displayValue = this.props.show ? "block" : "none";
|
|
57
|
-
|
|
58
56
|
return (
|
|
59
|
-
<div width="100%" className="palette-scroll"
|
|
60
|
-
style={{ display: displayValue }}
|
|
61
|
-
>
|
|
57
|
+
<div width="100%" className="palette-scroll">
|
|
62
58
|
{gridNodes}
|
|
63
59
|
</div>
|
|
64
60
|
);
|
|
@@ -68,7 +64,6 @@ class PaletteDialogContentGrid extends React.Component {
|
|
|
68
64
|
PaletteDialogContentGrid.propTypes = {
|
|
69
65
|
category: PropTypes.object.isRequired,
|
|
70
66
|
nodeTypes: PropTypes.array.isRequired,
|
|
71
|
-
show: PropTypes.bool.isRequired,
|
|
72
67
|
isEditingEnabled: PropTypes.bool.isRequired,
|
|
73
68
|
canvasController: PropTypes.object.isRequired
|
|
74
69
|
};
|
|
@@ -80,27 +80,29 @@ class PaletteDialogContent extends React.Component {
|
|
|
80
80
|
const category = this.getSelectedCategory(this.props.paletteJSON.categories);
|
|
81
81
|
const nodeTypes = category && category.node_types ? category.node_types : [];
|
|
82
82
|
const nodeTypeInfos = nodeTypes.map((nt) => ({ nodeType: nt, category: category }));
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<PaletteDialogContentCategories categories={cats}
|
|
87
|
-
selectedCategory={this.state.selectedCategory}
|
|
88
|
-
categorySelectedMethod={this.categorySelected}
|
|
89
|
-
/>
|
|
90
|
-
<PaletteDialogContentGrid show={this.props.showGrid}
|
|
83
|
+
const content = this.props.showGrid
|
|
84
|
+
? (
|
|
85
|
+
<PaletteDialogContentGrid
|
|
91
86
|
category={category}
|
|
92
87
|
nodeTypes={nodeTypes}
|
|
93
88
|
canvasController={this.props.canvasController}
|
|
94
89
|
isEditingEnabled={this.props.isEditingEnabled}
|
|
95
|
-
/>
|
|
96
|
-
|
|
90
|
+
/>)
|
|
91
|
+
: (
|
|
92
|
+
<PaletteContentList
|
|
97
93
|
category={category}
|
|
98
94
|
nodeTypeInfos={nodeTypeInfos}
|
|
99
95
|
canvasController={this.props.canvasController}
|
|
100
96
|
isPaletteOpen
|
|
101
|
-
isLastCategory={false}
|
|
102
97
|
isEditingEnabled={this.props.isEditingEnabled}
|
|
98
|
+
/>);
|
|
99
|
+
return (
|
|
100
|
+
<div className="palette-dialog-content" ref="palettecontent">
|
|
101
|
+
<PaletteDialogContentCategories categories={cats}
|
|
102
|
+
selectedCategory={this.state.selectedCategory}
|
|
103
|
+
categorySelectedMethod={this.categorySelected}
|
|
103
104
|
/>
|
|
105
|
+
{content}
|
|
104
106
|
</div>
|
|
105
107
|
);
|
|
106
108
|
}
|
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
import React from "react";
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
19
|
import { InlineLoading } from "carbon-components-react";
|
|
20
|
-
import Icon from "../icons/icon.jsx";
|
|
21
20
|
import SVG from "react-inlinesvg";
|
|
22
|
-
import { TIP_TYPE_PALETTE_CATEGORY
|
|
21
|
+
import { TIP_TYPE_PALETTE_CATEGORY } from "../common-canvas/constants/canvas-constants.js";
|
|
23
22
|
import { get } from "lodash";
|
|
23
|
+
import { AccordionItem } from "carbon-components-react";
|
|
24
|
+
import PaletteContentList from "./palette-content-list.jsx";
|
|
25
|
+
|
|
24
26
|
|
|
25
27
|
class PaletteFlyoutContentCategory extends React.Component {
|
|
26
28
|
constructor(props) {
|
|
@@ -63,7 +65,7 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
63
65
|
description = this.props.category.loading_text;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
const
|
|
68
|
+
const titleLoadingObj = (
|
|
67
69
|
<div className="palette-flyout-category">
|
|
68
70
|
<div className="palette-flyout-category-item-loading">
|
|
69
71
|
<InlineLoading
|
|
@@ -78,22 +80,14 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
78
80
|
</div>
|
|
79
81
|
</div>
|
|
80
82
|
);
|
|
83
|
+
|
|
84
|
+
const content = (
|
|
85
|
+
<AccordionItem className="palette-loading-category" title={titleLoadingObj} />
|
|
86
|
+
);
|
|
81
87
|
return content;
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
getRenderCategory() {
|
|
85
|
-
let caretClassName = "palette-flyout-category-caret";
|
|
86
|
-
if (!this.props.isPaletteOpen) {
|
|
87
|
-
caretClassName += " palette-flyout-category-caret-closed"; // When palette is closed extra style
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
let caretImage = null;
|
|
91
|
-
if (this.props.itemCount > 0 || this.props.category.empty_text) {
|
|
92
|
-
caretImage = this.props.isCategorySelected
|
|
93
|
-
? <Icon type={CANVAS_CARBON_ICONS.CHEVRONARROWS.UP} className={caretClassName} />
|
|
94
|
-
: <Icon type={CANVAS_CARBON_ICONS.CHEVRONARROWS.DOWN} className={caretClassName} />;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
91
|
let itemImage = null;
|
|
98
92
|
if (this.props.category.image && this.props.category.image !== "") {
|
|
99
93
|
if (this.props.category.image.endsWith(".svg")) {
|
|
@@ -131,8 +125,8 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
131
125
|
</span>
|
|
132
126
|
);
|
|
133
127
|
}
|
|
134
|
-
|
|
135
|
-
const
|
|
128
|
+
const nodeTypeInfos = this.props.category.node_types.map((nt) => ({ nodeType: nt, category: this.props.category }));
|
|
129
|
+
const titleObj = (
|
|
136
130
|
<div className="palette-flyout-category"
|
|
137
131
|
data-id={get(this.props.category, "id", "")}
|
|
138
132
|
onClick={this.categorySelected}
|
|
@@ -143,11 +137,20 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
143
137
|
<div className="palette-flyout-category-item">
|
|
144
138
|
{itemImage}
|
|
145
139
|
{itemText}
|
|
146
|
-
</div>
|
|
147
|
-
|
|
148
|
-
|
|
140
|
+
</div></div>
|
|
141
|
+
);
|
|
142
|
+
return (
|
|
143
|
+
<AccordionItem title={titleObj}>
|
|
144
|
+
<PaletteContentList
|
|
145
|
+
key={this.props.category.id + "-nodes"}
|
|
146
|
+
category={this.props.category}
|
|
147
|
+
nodeTypeInfos={nodeTypeInfos}
|
|
148
|
+
canvasController={this.props.canvasController}
|
|
149
|
+
isPaletteOpen={this.props.isPaletteOpen}
|
|
150
|
+
isEditingEnabled={this.props.isEditingEnabled}
|
|
151
|
+
/>
|
|
152
|
+
</AccordionItem>
|
|
149
153
|
);
|
|
150
|
-
return content;
|
|
151
154
|
}
|
|
152
155
|
|
|
153
156
|
categorySelected() {
|
|
@@ -168,11 +171,10 @@ class PaletteFlyoutContentCategory extends React.Component {
|
|
|
168
171
|
|
|
169
172
|
PaletteFlyoutContentCategory.propTypes = {
|
|
170
173
|
category: PropTypes.object.isRequired,
|
|
171
|
-
isCategorySelected: PropTypes.bool.isRequired,
|
|
172
174
|
categorySelectedMethod: PropTypes.func.isRequired,
|
|
173
|
-
itemCount: PropTypes.number.isRequired,
|
|
174
175
|
canvasController: PropTypes.object.isRequired,
|
|
175
|
-
isPaletteOpen: PropTypes.bool.isRequired
|
|
176
|
+
isPaletteOpen: PropTypes.bool.isRequired,
|
|
177
|
+
isEditingEnabled: PropTypes.bool.isRequired,
|
|
176
178
|
};
|
|
177
179
|
|
|
178
180
|
export default PaletteFlyoutContentCategory;
|
|
@@ -20,9 +20,10 @@ import { debounce } from "lodash";
|
|
|
20
20
|
import { getFilteredNodeTypeInfos } from "./palette-flyout-utils.js";
|
|
21
21
|
import PaletteFlyoutContentCategory from "./palette-flyout-content-category.jsx";
|
|
22
22
|
import PaletteFlyoutContentSearch from "./palette-flyout-content-search.jsx";
|
|
23
|
-
import PaletteContentList from "./palette-content-list.jsx";
|
|
24
23
|
import PaletteFlyoutContentFilteredList from "./palette-flyout-content-filtered-list.jsx";
|
|
25
24
|
import Logger from "../logging/canvas-logger.js";
|
|
25
|
+
import { Accordion } from "carbon-components-react";
|
|
26
|
+
|
|
26
27
|
|
|
27
28
|
const logger = new Logger("PaletteFlyoutContent");
|
|
28
29
|
|
|
@@ -71,41 +72,20 @@ class PaletteFlyoutContent extends React.Component {
|
|
|
71
72
|
const contentDivs = [];
|
|
72
73
|
for (let idx = 0; idx < categories.length; idx++) {
|
|
73
74
|
const category = categories[idx];
|
|
74
|
-
const isLastCategory = idx === categories.length - 1;
|
|
75
|
-
const nodeTypeInfos = category.node_types.map((nt) => ({ nodeType: nt, category: category }));
|
|
76
|
-
const isCategorySelected = this.isCategorySelected(category.id);
|
|
77
|
-
|
|
78
|
-
let content = null;
|
|
79
|
-
if (isCategorySelected) {
|
|
80
|
-
content = (
|
|
81
|
-
<PaletteContentList
|
|
82
|
-
key={category.label + "-nodes"}
|
|
83
|
-
show
|
|
84
|
-
category={category}
|
|
85
|
-
nodeTypeInfos={nodeTypeInfos}
|
|
86
|
-
canvasController={this.props.canvasController}
|
|
87
|
-
isPaletteOpen={this.props.isPaletteOpen}
|
|
88
|
-
isLastCategory={isLastCategory}
|
|
89
|
-
isEditingEnabled={this.props.isEditingEnabled}
|
|
90
|
-
/>);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
75
|
contentDivs.push(
|
|
94
76
|
<div key={category.label + "-container"}>
|
|
95
77
|
<PaletteFlyoutContentCategory
|
|
96
78
|
key={category.id}
|
|
97
79
|
category={category}
|
|
98
|
-
isCategorySelected={isCategorySelected}
|
|
99
80
|
categorySelectedMethod={this.categorySelected}
|
|
100
|
-
itemCount={nodeTypeInfos.length}
|
|
101
81
|
canvasController={this.props.canvasController}
|
|
102
82
|
isPaletteOpen={this.props.isPaletteOpen}
|
|
83
|
+
isEditingEnabled={this.props.isEditingEnabled}
|
|
103
84
|
/>
|
|
104
|
-
{content}
|
|
105
85
|
</div>
|
|
106
86
|
);
|
|
107
87
|
}
|
|
108
|
-
return contentDivs
|
|
88
|
+
return <Accordion>{contentDivs}</Accordion>;
|
|
109
89
|
}
|
|
110
90
|
|
|
111
91
|
getFilteredContentDivs(categories) {
|