@elyra/canvas 12.14.0 → 12.20.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/_baseForOwn-7d4e8506.js.map +1 -1
- package/dist/_baseForOwn-d38b560e.js.map +1 -1
- package/dist/canvas-constants-34cdb7df.js.map +1 -1
- package/dist/canvas-constants-3c09c7f6.js.map +1 -1
- package/dist/canvas-controller-ccb05f9f.js +2 -0
- package/dist/canvas-controller-ccb05f9f.js.map +1 -0
- package/dist/canvas-controller-feabad26.js +2 -0
- package/dist/canvas-controller-feabad26.js.map +1 -0
- package/dist/common-canvas-0c35f64f.js +2 -0
- package/dist/common-canvas-0c35f64f.js.map +1 -0
- package/dist/common-canvas-b60fe77c.js +2 -0
- package/dist/common-canvas-b60fe77c.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-5d20f9bf.js +2 -0
- package/dist/common-properties-5d20f9bf.js.map +1 -0
- package/dist/common-properties-80b89ad2.js +2 -0
- package/dist/common-properties-80b89ad2.js.map +1 -0
- package/dist/createClass-32a0cf0f.js.map +1 -1
- package/dist/createClass-6db89a23.js.map +1 -1
- package/dist/datarecord-metadata-v3-schema-6b6384ff.js.map +1 -1
- package/dist/datarecord-metadata-v3-schema-81228a9a.js.map +1 -1
- package/dist/en-7a0f1db1.js.map +1 -1
- package/dist/en-8647c347.js.map +1 -1
- package/dist/{extends-1139e06f.js → extends-42886b42.js} +2 -2
- package/dist/extends-42886b42.js.map +1 -0
- package/dist/{extends-8d17c85c.js → extends-634d1af7.js} +2 -2
- package/dist/extends-634d1af7.js.map +1 -0
- package/dist/flexible-table-72146c49.js +2 -0
- package/dist/flexible-table-72146c49.js.map +1 -0
- package/dist/flexible-table-fa8e4aa4.js +2 -0
- package/dist/flexible-table-fa8e4aa4.js.map +1 -0
- package/dist/getPrototypeOf-a1c3fe64.js.map +1 -1
- package/dist/getPrototypeOf-bf88242f.js.map +1 -1
- package/dist/{icon-918d2dd3.js → icon-079f1f09.js} +2 -2
- package/dist/{icon-918d2dd3.js.map → icon-079f1f09.js.map} +1 -1
- package/dist/{icon-4882a57f.js → icon-4ba4a133.js} +2 -2
- package/dist/{icon-4882a57f.js.map → icon-4ba4a133.js.map} +1 -1
- package/dist/index-ddc2e031.js +2 -0
- package/dist/index-ddc2e031.js.map +1 -0
- package/dist/{index-669f95a7.js → index-e0fcee5d.js} +2 -2
- package/dist/index-e0fcee5d.js.map +1 -0
- package/dist/isArrayLikeObject-a9c7973b.js.map +1 -1
- package/dist/isArrayLikeObject-f3b27f64.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/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/styles/common-canvas.min.css +1 -1
- package/dist/styles/common-canvas.min.css.map +1 -1
- package/dist/{toolbar-3f4b173f.js → toolbar-011cf35e.js} +2 -2
- package/dist/{toolbar-3f4b173f.js.map → toolbar-011cf35e.js.map} +1 -1
- package/dist/{toolbar-29ec7983.js → toolbar-91cb4665.js} +2 -2
- package/dist/{toolbar-29ec7983.js.map → toolbar-91cb4665.js.map} +1 -1
- package/locales/command-actions/locales/de.json +8 -8
- package/locales/command-actions/locales/es.json +8 -8
- package/locales/command-actions/locales/fr.json +9 -9
- package/locales/command-actions/locales/index.js +3 -1
- package/locales/command-actions/locales/it.json +13 -13
- package/locales/command-actions/locales/ja.json +8 -8
- package/locales/command-actions/locales/ko.json +8 -8
- package/locales/command-actions/locales/pt-br.json +10 -10
- package/locales/command-actions/locales/sv.json +51 -0
- package/locales/command-actions/locales/zh-CN.json +8 -8
- package/locales/command-actions/locales/zh-TW.json +10 -10
- package/locales/common-canvas/locales/de.json +18 -4
- package/locales/common-canvas/locales/es.json +16 -2
- package/locales/common-canvas/locales/fr.json +16 -2
- package/locales/common-canvas/locales/index.js +3 -1
- package/locales/common-canvas/locales/it.json +17 -3
- package/locales/common-canvas/locales/ja.json +19 -5
- package/locales/common-canvas/locales/ko.json +25 -11
- package/locales/common-canvas/locales/pt-br.json +18 -4
- package/locales/common-canvas/locales/sv.json +51 -0
- package/locales/common-canvas/locales/zh-CN.json +15 -1
- package/locales/common-canvas/locales/zh-TW.json +15 -1
- package/locales/common-properties/locales/de.json +22 -22
- package/locales/common-properties/locales/en.json +3 -1
- package/locales/common-properties/locales/eo.json +2 -0
- package/locales/common-properties/locales/es.json +12 -12
- package/locales/common-properties/locales/fr.json +22 -22
- package/locales/common-properties/locales/index.js +3 -1
- package/locales/common-properties/locales/it.json +13 -13
- package/locales/common-properties/locales/ja.json +28 -28
- package/locales/common-properties/locales/ko.json +10 -10
- package/locales/common-properties/locales/pt-br.json +16 -16
- package/locales/common-properties/locales/sv.json +93 -0
- package/locales/common-properties/locales/zh-CN.json +28 -28
- package/locales/common-properties/locales/zh-TW.json +26 -26
- package/locales/palette/locales/index.js +3 -1
- package/locales/palette/locales/it.json +1 -1
- package/locales/palette/locales/ja.json +1 -1
- package/locales/palette/locales/pt-br.json +1 -1
- package/locales/palette/locales/sv.json +10 -0
- package/locales/palette/locales/zh-CN.json +4 -4
- package/locales/palette/locales/zh-TW.json +2 -2
- package/locales/toolbar/locales/es.json +1 -1
- package/locales/toolbar/locales/index.js +3 -1
- package/locales/toolbar/locales/it.json +2 -2
- package/locales/toolbar/locales/pt-br.json +1 -1
- package/locales/toolbar/locales/sv.json +8 -0
- package/package.json +2 -2
- package/src/command-actions/createCommentAction.js +5 -9
- package/src/command-actions/createSuperNodeAction.js +358 -268
- package/src/common-canvas/canvas-controller.js +20 -5
- package/src/common-canvas/common-canvas-utils.js +38 -5
- package/src/common-canvas/svg-canvas-d3.js +2 -2
- package/src/common-canvas/svg-canvas-d3.scss +17 -11
- package/src/common-canvas/svg-canvas-pipeline.js +10 -3
- package/src/common-canvas/svg-canvas-renderer.js +93 -493
- package/src/common-canvas/svg-canvas-utils-decs.js +0 -5
- package/src/common-canvas/svg-canvas-utils-links.js +5 -1
- package/src/common-canvas/svg-canvas-utils-nodes.js +23 -5
- package/src/common-canvas/svg-canvas-utils-textarea.js +472 -0
- package/src/common-properties/actions.js +5 -0
- package/src/common-properties/components/title-editor/title-editor.jsx +2 -2
- package/src/common-properties/components/title-editor/title-editor.scss +1 -16
- package/src/common-properties/components/virtualized-table/virtualized-table.jsx +5 -5
- package/src/common-properties/components/wide-flyout/wide-flyout.jsx +5 -2
- package/src/common-properties/constants/constants.js +8 -1
- package/src/common-properties/constants/form-constants.js +1 -0
- package/src/common-properties/controls/abstract-table.jsx +2 -2
- package/src/common-properties/controls/control-factory.js +5 -0
- package/src/common-properties/controls/controls.scss +1 -0
- package/src/common-properties/controls/dropdown/dropdown.jsx +7 -5
- package/src/common-properties/controls/expression/expression.jsx +2 -1
- package/src/common-properties/controls/expression/expression.scss +60 -33
- package/src/common-properties/controls/radioset/radioset.jsx +16 -14
- package/src/common-properties/controls/radioset/radioset.scss +13 -11
- package/src/common-properties/controls/someofselect/someofselect.jsx +4 -4
- package/src/common-properties/controls/toggle/index.jsx +18 -0
- package/src/common-properties/controls/toggle/toggle.jsx +89 -0
- package/src/common-properties/controls/toggle/toggle.scss +23 -0
- package/src/common-properties/panels/summary/summary.jsx +5 -2
- package/src/common-properties/properties-controller.js +31 -13
- package/src/common-properties/properties-main/properties-main.jsx +1 -0
- package/src/common-properties/properties-store.js +19 -2
- package/src/common-properties/reducers/wide-flyout-primary-button-disable.jsx +31 -0
- package/src/common-properties/ui-conditions/condition-ops/colDoesExists.js +9 -3
- package/src/common-properties/ui-conditions/conditions-utils.js +10 -16
- package/src/object-model/api-pipeline.js +30 -10
- package/src/object-model/config-utils.js +1 -0
- package/src/object-model/layout-dimensions.js +9 -5
- package/src/palette/palette-content-list-item.jsx +3 -1
- package/src/palette/palette-flyout-content-category.jsx +73 -42
- package/src/palette/palette.scss +1 -1
- package/stats.html +1 -1
- package/dist/canvas-controller-8e2bb291.js +0 -2
- package/dist/canvas-controller-8e2bb291.js.map +0 -1
- package/dist/canvas-controller-bd0d8d59.js +0 -2
- package/dist/canvas-controller-bd0d8d59.js.map +0 -1
- package/dist/common-canvas-69fe4a67.js +0 -2
- package/dist/common-canvas-69fe4a67.js.map +0 -1
- package/dist/common-canvas-f5e4af65.js +0 -2
- package/dist/common-canvas-f5e4af65.js.map +0 -1
- package/dist/common-properties-40648163.js +0 -2
- package/dist/common-properties-40648163.js.map +0 -1
- package/dist/common-properties-6d839df1.js +0 -2
- package/dist/common-properties-6d839df1.js.map +0 -1
- package/dist/extends-1139e06f.js.map +0 -1
- package/dist/extends-8d17c85c.js.map +0 -1
- package/dist/flexible-table-d3598aa8.js +0 -2
- package/dist/flexible-table-d3598aa8.js.map +0 -1
- package/dist/flexible-table-fe7fbc13.js +0 -2
- package/dist/flexible-table-fe7fbc13.js.map +0 -1
- package/dist/index-669f95a7.js.map +0 -1
- package/dist/index-6d3404e1.js +0 -2
- package/dist/index-6d3404e1.js.map +0 -1
|
@@ -27,7 +27,7 @@ import classNames from "classnames";
|
|
|
27
27
|
import { Add16, TrashCan16, Edit16 } from "@carbon/icons-react";
|
|
28
28
|
import { ControlType, EditStyle } from "./../constants/form-constants";
|
|
29
29
|
|
|
30
|
-
import { MESSAGE_KEYS, STATES, TABLE_SUBPANEL_BUTTON_WIDTH, SORT_DIRECTION, ROW_SELECTION } from "./../constants/constants";
|
|
30
|
+
import { MESSAGE_KEYS, STATES, TABLE_SUBPANEL_BUTTON_WIDTH, SORT_DIRECTION, ROW_SELECTION, UPDATE_TYPE } from "./../constants/constants";
|
|
31
31
|
|
|
32
32
|
import { isEqual, findIndex, sortBy, cloneDeep } from "lodash";
|
|
33
33
|
|
|
@@ -85,7 +85,7 @@ export default class AbstractTable extends React.Component {
|
|
|
85
85
|
componentDidMount() {
|
|
86
86
|
if (this.props.control.subControls) {
|
|
87
87
|
const updatedControlValues = this.setReadOnlyColumnValue();
|
|
88
|
-
this.props.controller.updatePropertyValue(this.props.propertyId, updatedControlValues, true);
|
|
88
|
+
this.props.controller.updatePropertyValue(this.props.propertyId, updatedControlValues, true, UPDATE_TYPE.INITIAL_LOAD);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -35,6 +35,7 @@ import NumberfieldControl from "./numberfield";
|
|
|
35
35
|
import DatefieldControl from "./datefield";
|
|
36
36
|
import TimefieldControl from "./timefield";
|
|
37
37
|
import CheckboxControl from "./checkbox";
|
|
38
|
+
import ToggleControl from "./toggle";
|
|
38
39
|
import CheckboxsetControl from "./checkboxset";
|
|
39
40
|
import RadiosetControl from "./radioset";
|
|
40
41
|
import Dropdown from "./dropdown";
|
|
@@ -66,6 +67,7 @@ const accessibleControls = [
|
|
|
66
67
|
ControlType.TIMEFIELD,
|
|
67
68
|
ControlType.TOGGLETEXT,
|
|
68
69
|
ControlType.LIST,
|
|
70
|
+
ControlType.TOGGLE,
|
|
69
71
|
ControlType.SOMEOFSELECT,
|
|
70
72
|
ControlType.SELECTCOLUMNS,
|
|
71
73
|
ControlType.READONLY,
|
|
@@ -183,6 +185,9 @@ export default class ControlFactory {
|
|
|
183
185
|
case (ControlType.TEXTAREA):
|
|
184
186
|
createdControl = (<TextareaControl {...props} />);
|
|
185
187
|
break;
|
|
188
|
+
case (ControlType.TOGGLE):
|
|
189
|
+
createdControl = (<ToggleControl {...props} />);
|
|
190
|
+
break;
|
|
186
191
|
case (ControlType.LIST):
|
|
187
192
|
createdControl = (<ListControl {...props} />);
|
|
188
193
|
break;
|
|
@@ -24,7 +24,7 @@ import ValidationMessage from "./../../components/validation-message";
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
25
|
import * as PropertyUtils from "./../../util/property-utils.js";
|
|
26
26
|
import { ControlType } from "./../../constants/form-constants";
|
|
27
|
-
import { MESSAGE_KEYS, STATES } from "./../../constants/constants.js";
|
|
27
|
+
import { MESSAGE_KEYS, STATES, UPDATE_TYPE } from "./../../constants/constants.js";
|
|
28
28
|
import { formatMessage } from "./../../util/property-utils";
|
|
29
29
|
|
|
30
30
|
class DropDown extends React.Component {
|
|
@@ -46,7 +46,7 @@ class DropDown extends React.Component {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
componentDidMount() {
|
|
49
|
-
this.updateValueFromFilterEnum(true);
|
|
49
|
+
this.updateValueFromFilterEnum(true, UPDATE_TYPE.INITIAL_LOAD);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
componentDidUpdate(prevProps) {
|
|
@@ -63,8 +63,10 @@ class DropDown extends React.Component {
|
|
|
63
63
|
});
|
|
64
64
|
selectedOption = typeof selectedOption === "undefined" ? null : selectedOption;
|
|
65
65
|
|
|
66
|
+
// Show the existing value but with a warning instead of filtering it out.
|
|
67
|
+
const showExistingValue = (selectedOption === null && value);
|
|
66
68
|
// user defined value
|
|
67
|
-
if (
|
|
69
|
+
if (showExistingValue || this.props.control.customValueAllowed) {
|
|
68
70
|
selectedOption = {
|
|
69
71
|
value: value,
|
|
70
72
|
label: value
|
|
@@ -132,7 +134,7 @@ class DropDown extends React.Component {
|
|
|
132
134
|
};
|
|
133
135
|
}
|
|
134
136
|
// this is needed in order to reset the property value when a value is filtered out.
|
|
135
|
-
updateValueFromFilterEnum(skipValidateInput) {
|
|
137
|
+
updateValueFromFilterEnum(skipValidateInput, updateType) {
|
|
136
138
|
// update property value if value isn't in current enum value. Should only be used for oneofselect
|
|
137
139
|
if (this.props.control.controlType === ControlType.ONEOFSELECT && this.props.value !== null && typeof this.props.value !== "undefined" &&
|
|
138
140
|
!this.props.controlOpts.values.includes(this.props.value)) {
|
|
@@ -143,7 +145,7 @@ class DropDown extends React.Component {
|
|
|
143
145
|
} else if (this.props.control.customValueAllowed && this.props.value) {
|
|
144
146
|
defaultValue = this.props.value;
|
|
145
147
|
}
|
|
146
|
-
this.props.controller.updatePropertyValue(this.props.propertyId, defaultValue, skipValidateInput);
|
|
148
|
+
this.props.controller.updatePropertyValue(this.props.propertyId, defaultValue, skipValidateInput, updateType);
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
|
|
@@ -312,7 +312,8 @@ class ExpressionControl extends React.Component {
|
|
|
312
312
|
theme: theme + " custom",
|
|
313
313
|
readOnly: (this.props.state === STATES.DISABLED) ? "nocursor" : false,
|
|
314
314
|
extraKeys: { "Ctrl-Space": "autocomplete" },
|
|
315
|
-
autoRefresh: true
|
|
315
|
+
autoRefresh: true,
|
|
316
|
+
lineNumbers: true
|
|
316
317
|
};
|
|
317
318
|
const applyLabel = formatMessage(reactIntl, MESSAGE_KEYS.APPLYBUTTON_LABEL);
|
|
318
319
|
const rejectLabel = formatMessage(reactIntl, MESSAGE_KEYS.REJECTBUTTON_LABEL);
|
|
@@ -16,54 +16,81 @@
|
|
|
16
16
|
|
|
17
17
|
@import "./expression-builder/expression-builder";
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
.CodeMirror
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
.react-codemirror2 {
|
|
20
|
+
.CodeMirror {
|
|
21
|
+
width: 100%;
|
|
22
|
+
background: $field-02;
|
|
23
|
+
color: $text-01;
|
|
23
24
|
|
|
24
|
-
.CodeMirror-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
.CodeMirror-gutters {
|
|
26
|
+
border-right: none;
|
|
27
|
+
background-color: inherit;
|
|
28
|
+
}
|
|
27
29
|
|
|
28
|
-
.CodeMirror {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
30
|
+
.CodeMirror-lines {
|
|
31
|
+
padding-top: $spacing-05;
|
|
32
|
+
.CodeMirror-line-like {
|
|
33
|
+
padding-left: $spacing-03;
|
|
34
|
+
}
|
|
35
|
+
.CodeMirror-placeholder {
|
|
36
|
+
opacity: 0.5;
|
|
37
|
+
@include carbon--type-style("code-02");
|
|
38
|
+
}
|
|
39
|
+
.CodeMirror-cursor {
|
|
40
|
+
border-left: 1px solid $text-01;
|
|
41
|
+
}
|
|
42
|
+
.CodeMirror-code {
|
|
33
43
|
|
|
34
|
-
.CodeMirror-
|
|
35
|
-
|
|
36
|
-
}
|
|
44
|
+
.CodeMirror-linenumber {
|
|
45
|
+
@include carbon--type-style("body-short-01");
|
|
46
|
+
}
|
|
37
47
|
|
|
38
|
-
.
|
|
48
|
+
.CodeMirror-line {
|
|
49
|
+
padding-left: $spacing-03;
|
|
39
50
|
|
|
40
|
-
|
|
51
|
+
span {
|
|
52
|
+
@include carbon--type-style("code-02");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
41
58
|
|
|
42
|
-
.cm-s-
|
|
59
|
+
.cm-s-error.CodeMirror { border: $spacing-01 solid $support-01; }
|
|
43
60
|
|
|
44
|
-
.cm-s-
|
|
61
|
+
.cm-s-warning.CodeMirror { border: $spacing-01 solid $support-03; }
|
|
45
62
|
|
|
46
|
-
.cm-s-
|
|
63
|
+
.cm-s-disabled.CodeMirror { opacity: 0.5}
|
|
47
64
|
|
|
48
|
-
.cm-s-custom .cm-
|
|
65
|
+
.cm-s-custom .cm-keyword { color: $link-01; }
|
|
49
66
|
|
|
50
|
-
.cm-s-custom .cm-
|
|
67
|
+
.cm-s-custom .cm-number { color: $text-02; }
|
|
51
68
|
|
|
52
|
-
.cm-s-custom .cm-
|
|
53
|
-
|
|
54
|
-
.cm-s-custom .cm-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
.cm-s-custom .cm-
|
|
69
|
+
.cm-s-custom .cm-def { color: $support-01; }
|
|
70
|
+
|
|
71
|
+
.cm-s-custom .cm-comment { color: $support-02; }
|
|
72
|
+
|
|
73
|
+
.cm-s-custom .cm-variable,
|
|
74
|
+
.cm-s-custom .cm-punctuation,
|
|
75
|
+
.cm-s-custom .cm-property,
|
|
76
|
+
.cm-s-custom .cm-operator {
|
|
77
|
+
color: $text-01;
|
|
78
|
+
}
|
|
79
|
+
.cm-s-custom .cm-variable-2 { color: $text-01; }
|
|
59
80
|
|
|
60
|
-
.cm-s-custom .cm-variable-3, .cm-s-custom .cm-type { color: $text-01; }
|
|
81
|
+
.cm-s-custom .cm-variable-3, .cm-s-custom .cm-type { color: $text-01; }
|
|
61
82
|
|
|
62
|
-
.cm-s-custom .cm-string { color: $text-error; }
|
|
83
|
+
.cm-s-custom .cm-string { color: $text-error; }
|
|
63
84
|
|
|
64
|
-
.cm-s-custom .cm-string-2 { color: $text-error; }
|
|
85
|
+
.cm-s-custom .cm-string-2 { color: $text-error; }
|
|
65
86
|
|
|
66
|
-
.cm-s-custom .cm-meta { color: $ui-01; }
|
|
87
|
+
.cm-s-custom .cm-meta { color: $ui-01; }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Override so Codemirror autocomplete shows up on top */
|
|
91
|
+
.CodeMirror-hints {
|
|
92
|
+
z-index: 1110;
|
|
93
|
+
}
|
|
67
94
|
|
|
68
95
|
.properties-expression-editor {
|
|
69
96
|
border: 1px solid $ui-03;
|
|
@@ -23,7 +23,7 @@ import * as ConditionsUtils from "./../../ui-conditions/conditions-utils.js";
|
|
|
23
23
|
import ValidationMessage from "./../../components/validation-message";
|
|
24
24
|
import { RadioButton } from "carbon-components-react";
|
|
25
25
|
import classNames from "classnames";
|
|
26
|
-
import { STATES } from "./../../constants/constants.js";
|
|
26
|
+
import { STATES, UPDATE_TYPE } from "./../../constants/constants.js";
|
|
27
27
|
import { ORIENTATIONS } from "./../../constants/form-constants.js";
|
|
28
28
|
import { v4 as uuid4 } from "uuid";
|
|
29
29
|
import { Information16 } from "@carbon/icons-react";
|
|
@@ -39,7 +39,7 @@ class RadiosetControl extends React.Component {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
componentDidMount() {
|
|
42
|
-
this.updateValueFromFilterEnum(true);
|
|
42
|
+
this.updateValueFromFilterEnum(true, UPDATE_TYPE.INITIAL_LOAD);
|
|
43
43
|
const val = this.props.controller.getPropertyValue(this.props.propertyId);
|
|
44
44
|
this.setEnabledStateOfOptionalPanels(val);
|
|
45
45
|
if (typeof this.props.value !== "undefined" && this.props.value !== null) {
|
|
@@ -92,7 +92,7 @@ class RadiosetControl extends React.Component {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// this is needed in order to reset the property value when a value is filtered out.
|
|
95
|
-
updateValueFromFilterEnum(skipValidateInput) {
|
|
95
|
+
updateValueFromFilterEnum(skipValidateInput, updateType) {
|
|
96
96
|
if (this.props.value !== null && typeof this.props.value !== "undefined" &&
|
|
97
97
|
!this.props.controlOpts.values.includes(this.props.value)) {
|
|
98
98
|
let defaultValue = null;
|
|
@@ -100,7 +100,7 @@ class RadiosetControl extends React.Component {
|
|
|
100
100
|
if (this.props.control.valueDef && this.props.control.valueDef.defaultValue && this.props.controlOpts.values.includes(this.props.control.valueDef.defaultValue)) {
|
|
101
101
|
defaultValue = this.props.control.valueDef.defaultValue;
|
|
102
102
|
}
|
|
103
|
-
this.props.controller.updatePropertyValue(this.props.propertyId, defaultValue, skipValidateInput);
|
|
103
|
+
this.props.controller.updatePropertyValue(this.props.propertyId, defaultValue, skipValidateInput, updateType);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -202,16 +202,18 @@ class RadiosetControl extends React.Component {
|
|
|
202
202
|
};
|
|
203
203
|
buttons.push(
|
|
204
204
|
<div key={i} className="properties-radioset-panel">
|
|
205
|
-
<
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
205
|
+
<div className="properties-radioset-tooltip">
|
|
206
|
+
<RadioButton
|
|
207
|
+
key={i}
|
|
208
|
+
id={ControlUtils.getControlId(id, this.uuid)}
|
|
209
|
+
disabled={disabled || itemDisabled}
|
|
210
|
+
labelText={valueSet.valueLabels[i]}
|
|
211
|
+
value={val}
|
|
212
|
+
onChange={this.handleChange}
|
|
213
|
+
checked={checked}
|
|
214
|
+
/>
|
|
215
|
+
{tooltipIcon}
|
|
216
|
+
</div>
|
|
215
217
|
{optionalPanel}
|
|
216
218
|
</div>
|
|
217
219
|
);
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
|
|
26
27
|
.properties-radio-button-group {
|
|
27
28
|
display: block;
|
|
28
29
|
&.horizontal {
|
|
@@ -38,28 +39,29 @@
|
|
|
38
39
|
.properties-radioset-panel {
|
|
39
40
|
margin-bottom: $spacing-02;
|
|
40
41
|
margin-right: $spacing-04;
|
|
41
|
-
display:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"panel panel";
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: flex-start;
|
|
44
|
+
align-items: center;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
overflow: hidden;
|
|
47
47
|
.bx--radio-button-wrapper{
|
|
48
|
-
grid-area: radio;
|
|
49
48
|
margin-right: 0; // We removed the space between radio & tooltip to position it correctly
|
|
50
49
|
}
|
|
51
|
-
.tooltip
|
|
52
|
-
|
|
50
|
+
.properties-radioset-tooltip {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
margin: 2.5px 0 1.5px 1.5px;
|
|
53
54
|
}
|
|
54
55
|
.properties-control-nested-panel{
|
|
55
|
-
|
|
56
|
+
flex-basis: 100%;
|
|
57
|
+
width: 100%;
|
|
56
58
|
}
|
|
57
59
|
&:last-of-type {
|
|
58
60
|
margin-bottom: 0; // don't want margin when last radio button in group
|
|
59
61
|
}
|
|
60
|
-
|
|
61
62
|
.bx--radio-button-wrapper > label {
|
|
62
63
|
justify-content: left; // override carbon style to center justify radio-button labels
|
|
64
|
+
align-items: center;
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
&.error:not([disabled]) {
|
|
@@ -23,7 +23,7 @@ import ValidationMessage from "./../../components/validation-message";
|
|
|
23
23
|
import classNames from "classnames";
|
|
24
24
|
import { isEqual, intersection } from "lodash";
|
|
25
25
|
|
|
26
|
-
import { STATES } from "../../constants/constants";
|
|
26
|
+
import { STATES, UPDATE_TYPE } from "../../constants/constants";
|
|
27
27
|
|
|
28
28
|
class SomeofselectControl extends React.Component {
|
|
29
29
|
constructor(props) {
|
|
@@ -34,7 +34,7 @@ class SomeofselectControl extends React.Component {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
componentDidMount() {
|
|
37
|
-
this.updateValueFromFilterEnum(true);
|
|
37
|
+
this.updateValueFromFilterEnum(true, UPDATE_TYPE.INITIAL_LOAD);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
componentDidUpdate(prevProps) {
|
|
@@ -45,10 +45,10 @@ class SomeofselectControl extends React.Component {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// this is needed in order to reset the property value when a value is filtered out.
|
|
48
|
-
updateValueFromFilterEnum(skipValidateInput) {
|
|
48
|
+
updateValueFromFilterEnum(skipValidateInput, updateType) {
|
|
49
49
|
const newValues = intersection(this.props.value, this.props.controlOpts.values);
|
|
50
50
|
if (!isEqual(newValues, this.props.value)) {
|
|
51
|
-
this.props.controller.updatePropertyValue(this.props.propertyId, newValues, skipValidateInput);
|
|
51
|
+
this.props.controller.updatePropertyValue(this.props.propertyId, newValues, skipValidateInput, updateType);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-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
|
+
import ToggleControl from "./toggle.jsx";
|
|
18
|
+
export default ToggleControl;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-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
|
+
import React from "react";
|
|
18
|
+
import PropTypes from "prop-types";
|
|
19
|
+
import { connect } from "react-redux";
|
|
20
|
+
import { Toggle } from "carbon-components-react";
|
|
21
|
+
import ValidationMessage from "./../../components/validation-message";
|
|
22
|
+
import * as ControlUtils from "./../../util/control-utils";
|
|
23
|
+
import { STATES, MESSAGE_KEYS } from "./../../constants/constants.js";
|
|
24
|
+
import classNames from "classnames";
|
|
25
|
+
import { formatMessage } from "./../../util/property-utils";
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ToggleControl extends React.Component {
|
|
29
|
+
constructor(props) {
|
|
30
|
+
super(props);
|
|
31
|
+
this.id = ControlUtils.getControlId(this.props.propertyId);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
handleChange(value) {
|
|
36
|
+
this.props.controller.updatePropertyValue(this.props.propertyId, value);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
render() {
|
|
40
|
+
const overrideLabelKeyOn = `${this.props.control.name}.toggle.on.label`;
|
|
41
|
+
const overrideLabelKeyOff = `${this.props.control.name}.toggle.off.label`;
|
|
42
|
+
|
|
43
|
+
const defaultOnEditLabel = formatMessage(this.reactIntl, MESSAGE_KEYS.TOGGLE_ON_LABEL);
|
|
44
|
+
const defaultOffEditLabel = formatMessage(this.reactIntl, MESSAGE_KEYS.TOGGLE_OFF_LABEL);
|
|
45
|
+
|
|
46
|
+
const labelOn = this.props.controller.getResource(overrideLabelKeyOn, defaultOnEditLabel);
|
|
47
|
+
const labelOff = this.props.controller.getResource(overrideLabelKeyOff, defaultOffEditLabel);
|
|
48
|
+
const size = this.props.tableControl ? "sm" : "md";
|
|
49
|
+
const toggleControl = (<Toggle
|
|
50
|
+
id={this.id}
|
|
51
|
+
size={size}
|
|
52
|
+
disabled={this.props.state === STATES.DISABLED}
|
|
53
|
+
toggled={Boolean(this.props.value)}
|
|
54
|
+
labelB={labelOn}
|
|
55
|
+
labelA={labelOff}
|
|
56
|
+
onToggle={this.handleChange.bind(this)}
|
|
57
|
+
labelText={this.props.controlItem}
|
|
58
|
+
/>);
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
const className = classNames("properties-toggle", { "hide": this.props.state === STATES.HIDDEN }, this.props.messageInfo ? this.props.messageInfo.type : null);
|
|
62
|
+
return (
|
|
63
|
+
<div className={className} data-id={ControlUtils.getDataId(this.props.propertyId)}>
|
|
64
|
+
{toggleControl}
|
|
65
|
+
<ValidationMessage inTable={this.props.tableControl} state={this.props.state} messageInfo={this.props.messageInfo} />
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
ToggleControl.propTypes = {
|
|
73
|
+
control: PropTypes.object.isRequired,
|
|
74
|
+
propertyId: PropTypes.object.isRequired,
|
|
75
|
+
controller: PropTypes.object.isRequired,
|
|
76
|
+
controlItem: PropTypes.element,
|
|
77
|
+
tableControl: PropTypes.bool,
|
|
78
|
+
state: PropTypes.string, // pass in by redux
|
|
79
|
+
value: PropTypes.bool, // pass in by redux
|
|
80
|
+
messageInfo: PropTypes.object // pass in by redux
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const mapStateToProps = (state, ownProps) => ({
|
|
84
|
+
value: ownProps.controller.getPropertyValue(ownProps.propertyId),
|
|
85
|
+
state: ownProps.controller.getControlState(ownProps.propertyId),
|
|
86
|
+
messageInfo: ownProps.controller.getErrorMessage(ownProps.propertyId)
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export default connect(mapStateToProps, null)(ToggleControl);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-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
|
+
.properties-table-cell-control { // overrides when in a table cell
|
|
18
|
+
.properties-toggle {
|
|
19
|
+
.bx--toggle__switch { // override carbon when inside a table
|
|
20
|
+
margin: $spacing-02 0;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -299,6 +299,7 @@ class SummaryPanel extends React.Component {
|
|
|
299
299
|
rejectLabel={rejectLabel}
|
|
300
300
|
title={this.props.panel.label}
|
|
301
301
|
light={this.props.controller.getLight()}
|
|
302
|
+
okButtonEnabled={this.props.okButtonEnabled}
|
|
302
303
|
>
|
|
303
304
|
<div>
|
|
304
305
|
{this.props.children}
|
|
@@ -326,11 +327,13 @@ SummaryPanel.propTypes = {
|
|
|
326
327
|
controller: PropTypes.object.isRequired,
|
|
327
328
|
children: PropTypes.array,
|
|
328
329
|
panel: PropTypes.object.isRequired,
|
|
329
|
-
panelState: PropTypes.string // set by redux
|
|
330
|
+
panelState: PropTypes.string, // set by redux
|
|
331
|
+
okButtonEnabled: PropTypes.bool // set by redux
|
|
330
332
|
};
|
|
331
333
|
|
|
332
334
|
const mapStateToProps = (state, ownProps) => ({
|
|
333
|
-
panelState: ownProps.controller.getPanelState({ name: ownProps.panel.id })
|
|
335
|
+
panelState: ownProps.controller.getPanelState({ name: ownProps.panel.id }),
|
|
336
|
+
okButtonEnabled: !ownProps.controller.getWideFlyoutPrimaryButtonDisabled({ name: ownProps.panel.id })
|
|
334
337
|
});
|
|
335
338
|
|
|
336
339
|
export default connect(mapStateToProps, null)(SummaryPanel);
|
|
@@ -24,7 +24,7 @@ import { parseUiContent } from "./ui-conditions/ui-groups-parser.js";
|
|
|
24
24
|
import * as conditionsUtil from "./ui-conditions/conditions-utils";
|
|
25
25
|
import * as PropertyUtils from "./util/property-utils.js";
|
|
26
26
|
|
|
27
|
-
import { STATES, ACTIONS, CONDITION_TYPE, PANEL_TREE_ROOT, CONDITION_MESSAGE_TYPE } from "./constants/constants.js";
|
|
27
|
+
import { STATES, ACTIONS, CONDITION_TYPE, PANEL_TREE_ROOT, CONDITION_MESSAGE_TYPE, UPDATE_TYPE } from "./constants/constants.js";
|
|
28
28
|
import CommandStack from "../command-stack/command-stack.js";
|
|
29
29
|
import ControlFactory from "./controls/control-factory";
|
|
30
30
|
import { Type, ParamRole, ControlType } from "./constants/form-constants";
|
|
@@ -382,11 +382,11 @@ export default class PropertiesController {
|
|
|
382
382
|
if (resolveParameterRefs) {
|
|
383
383
|
if (typeof controlValue !== "undefined" && controlValue !== null && typeof controlValue.parameterRef !== "undefined") {
|
|
384
384
|
controlValue = this.getPropertyValue({ name: controlValue.parameterRef });
|
|
385
|
-
this.updatePropertyValue(propertyId, controlValue, true);
|
|
385
|
+
this.updatePropertyValue(propertyId, controlValue, true, UPDATE_TYPE.INITIAL_LOAD);
|
|
386
386
|
}
|
|
387
387
|
} else if (control.controlType === "structuretable" && control.addRemoveRows === false && control.includeAllFields === true) {
|
|
388
388
|
controlValue = this._populateFieldData(controlValue, control);
|
|
389
|
-
this.updatePropertyValue(propertyId, controlValue, true);
|
|
389
|
+
this.updatePropertyValue(propertyId, controlValue, true, UPDATE_TYPE.INITIAL_LOAD);
|
|
390
390
|
} else if (typeof control.valueDef !== "undefined" && typeof control.valueDef.defaultValue !== "undefined" &&
|
|
391
391
|
(typeof controlValue === "undefined")) {
|
|
392
392
|
controlValue = control.valueDef.defaultValue;
|
|
@@ -396,11 +396,11 @@ export default class PropertiesController {
|
|
|
396
396
|
controlValue = PropertyUtils.convertObjectStructureToArray(control.valueDef.isList, control.subControls, controlValue);
|
|
397
397
|
}
|
|
398
398
|
|
|
399
|
-
this.updatePropertyValue(propertyId, controlValue, true);
|
|
399
|
+
this.updatePropertyValue(propertyId, controlValue, true, UPDATE_TYPE.INITIAL_LOAD);
|
|
400
400
|
} else if (control.controlType === "structureeditor") {
|
|
401
401
|
if (!controlValue || (Array.isArray(controlValue) && controlValue.length === 0)) {
|
|
402
402
|
if (Array.isArray(control.defaultRow)) {
|
|
403
|
-
this.updatePropertyValue(propertyId, control.defaultRow, true);
|
|
403
|
+
this.updatePropertyValue(propertyId, control.defaultRow, true, UPDATE_TYPE.INITIAL_LOAD);
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
}
|
|
@@ -1019,7 +1019,7 @@ export default class PropertiesController {
|
|
|
1019
1019
|
/*
|
|
1020
1020
|
* Property Values Methods
|
|
1021
1021
|
*/
|
|
1022
|
-
updatePropertyValue(inPropertyId, value, skipValidateInput) {
|
|
1022
|
+
updatePropertyValue(inPropertyId, value, skipValidateInput, type) {
|
|
1023
1023
|
const propertyId = this.convertPropertyId(inPropertyId);
|
|
1024
1024
|
const initialValue = this.getPropertyValue(propertyId);
|
|
1025
1025
|
if (typeof value === "undefined") {
|
|
@@ -1038,13 +1038,15 @@ export default class PropertiesController {
|
|
|
1038
1038
|
|
|
1039
1039
|
if (this.handlers.propertyListener) {
|
|
1040
1040
|
const convertedValue = this._convertObjectStructure(propertyId, value);
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1041
|
+
const data = {
|
|
1042
|
+
action: ACTIONS.UPDATE_PROPERTY,
|
|
1043
|
+
property: propertyId,
|
|
1044
|
+
value: convertedValue
|
|
1045
|
+
};
|
|
1046
|
+
if (typeof type !== "undefined") {
|
|
1047
|
+
data.type = type;
|
|
1048
|
+
}
|
|
1049
|
+
this.handlers.propertyListener(data);
|
|
1048
1050
|
}
|
|
1049
1051
|
}
|
|
1050
1052
|
|
|
@@ -1628,6 +1630,22 @@ export default class PropertiesController {
|
|
|
1628
1630
|
return this.propertiesStore.getSaveButtonDisable();
|
|
1629
1631
|
}
|
|
1630
1632
|
|
|
1633
|
+
/**
|
|
1634
|
+
* Enable/disable OK button for given summary panel
|
|
1635
|
+
* @param panelId {name: panel.id}
|
|
1636
|
+
* @param wideFlyoutPrimaryButtonDisable boolean
|
|
1637
|
+
*/
|
|
1638
|
+
setWideFlyoutPrimaryButtonDisabled(panelId, wideFlyoutPrimaryButtonDisable) {
|
|
1639
|
+
this.propertiesStore.setWideFlyoutPrimaryButtonDisabled(panelId, wideFlyoutPrimaryButtonDisable);
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
/**
|
|
1643
|
+
* @param panelId {name: panel.id}
|
|
1644
|
+
*/
|
|
1645
|
+
getWideFlyoutPrimaryButtonDisabled(panelId) {
|
|
1646
|
+
return this.propertiesStore.getWideFlyoutPrimaryButtonDisabled(panelId);
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1631
1649
|
isRequired(propertyId) {
|
|
1632
1650
|
const control = this.getControl(propertyId);
|
|
1633
1651
|
if (control) {
|
|
@@ -69,6 +69,7 @@ class PropertiesMain extends React.Component {
|
|
|
69
69
|
this.setForm(props.propertiesInfo);
|
|
70
70
|
this.previousErrorMessages = {};
|
|
71
71
|
// this has to be after setForm because setForm clears all error messages.
|
|
72
|
+
// Validate all validationDefinitions but show warning messages for "colDoesExists" condition only
|
|
72
73
|
this.propertiesController.validatePropertiesValues(false);
|
|
73
74
|
if (props.propertiesInfo.messages) {
|
|
74
75
|
this.propertiesController.validatePropertiesValues(true);
|