@elyra/canvas 12.40.0 → 12.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{_baseIteratee-fb637d17.js → _baseIteratee-05ccf6a8.js} +3 -3
- package/dist/{_baseIteratee-fb637d17.js.map → _baseIteratee-05ccf6a8.js.map} +1 -1
- package/dist/{_baseIteratee-f4715b87.js → _baseIteratee-2b75d27c.js} +2 -2
- package/dist/{_baseIteratee-f4715b87.js.map → _baseIteratee-2b75d27c.js.map} +1 -1
- package/dist/canvas-constants-079172c0.js +2 -0
- package/dist/canvas-constants-079172c0.js.map +1 -0
- package/dist/canvas-constants-ff5cf88e.js +2 -0
- package/dist/canvas-constants-ff5cf88e.js.map +1 -0
- package/dist/canvas-controller-1e71b405.js +2 -0
- package/dist/{canvas-controller-bde80f8a.js.map → canvas-controller-1e71b405.js.map} +1 -1
- package/dist/canvas-controller-4bed5320.js +2 -0
- package/dist/{canvas-controller-95ecdee5.js.map → canvas-controller-4bed5320.js.map} +1 -1
- package/dist/common-canvas-097c5169.js +2 -0
- package/dist/{common-canvas-b32c379e.js.map → common-canvas-097c5169.js.map} +1 -1
- package/dist/common-canvas-e13c0858.js +2 -0
- package/dist/{common-canvas-32d7e405.js.map → common-canvas-e13c0858.js.map} +1 -1
- 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-706cef87.js +2 -0
- package/dist/common-properties-706cef87.js.map +1 -0
- package/dist/common-properties-9bd69b61.js +2 -0
- package/dist/common-properties-9bd69b61.js.map +1 -0
- package/dist/context-menu-wrapper-3a7fdec8.js +2 -0
- package/dist/context-menu-wrapper-3a7fdec8.js.map +1 -0
- package/dist/context-menu-wrapper-fc85d853.js +2 -0
- package/dist/context-menu-wrapper-fc85d853.js.map +1 -0
- package/dist/datarecord-metadata-v3-schema-59505bc5.js +2 -0
- package/dist/{datarecord-metadata-v3-schema-76e8fa3e.js.map → datarecord-metadata-v3-schema-59505bc5.js.map} +1 -1
- package/dist/datarecord-metadata-v3-schema-dba0b214.js +2 -0
- package/dist/{datarecord-metadata-v3-schema-9b4a5306.js.map → datarecord-metadata-v3-schema-dba0b214.js.map} +1 -1
- package/dist/defineProperty-3dc7d8d0.js +2 -0
- package/dist/defineProperty-3dc7d8d0.js.map +1 -0
- package/dist/defineProperty-6d406743.js +2 -0
- package/dist/defineProperty-6d406743.js.map +1 -0
- package/dist/{flexible-table-9de9d023.js → flexible-table-43e2d052.js} +2 -2
- package/dist/{flexible-table-9de9d023.js.map → flexible-table-43e2d052.js.map} +1 -1
- package/dist/{flexible-table-93144915.js → flexible-table-63ffd573.js} +2 -2
- package/dist/{flexible-table-93144915.js.map → flexible-table-63ffd573.js.map} +1 -1
- package/dist/{icon-9bf1b1d0.js → icon-0390f1fe.js} +2 -2
- package/dist/{icon-9bf1b1d0.js.map → icon-0390f1fe.js.map} +1 -1
- package/dist/{icon-1995d07f.js → icon-e622f99b.js} +2 -2
- package/dist/{icon-1995d07f.js.map → icon-e622f99b.js.map} +1 -1
- package/dist/index-1cd54914.js +2 -0
- package/dist/index-1cd54914.js.map +1 -0
- package/dist/index-57503b50.js +2 -0
- package/dist/index-57503b50.js.map +1 -0
- package/dist/{isArrayLikeObject-0cd02b77.js → isArrayLikeObject-04f333a5.js} +2 -2
- package/dist/{isArrayLikeObject-0cd02b77.js.map → isArrayLikeObject-04f333a5.js.map} +1 -1
- package/dist/{isArrayLikeObject-9104c690.js → isArrayLikeObject-36898fcb.js} +2 -2
- package/dist/{isArrayLikeObject-9104c690.js.map → isArrayLikeObject-36898fcb.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/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-dbe39e96.js → toolbar-918ab52e.js} +2 -2
- package/dist/{toolbar-dbe39e96.js.map → toolbar-918ab52e.js.map} +1 -1
- package/dist/{toolbar-8ed1e188.js → toolbar-fdb750f9.js} +2 -2
- package/dist/{toolbar-8ed1e188.js.map → toolbar-fdb750f9.js.map} +1 -1
- package/locales/common-properties/locales/de.json +1 -0
- package/locales/common-properties/locales/es.json +1 -0
- package/locales/common-properties/locales/fr.json +1 -0
- package/locales/common-properties/locales/it.json +1 -0
- package/locales/common-properties/locales/ja.json +1 -0
- package/locales/common-properties/locales/ko.json +1 -0
- package/locales/common-properties/locales/pt-br.json +1 -0
- package/locales/common-properties/locales/sv.json +1 -0
- package/locales/common-properties/locales/zh-CN.json +1 -0
- package/locales/common-properties/locales/zh-TW.json +1 -0
- package/package.json +1 -1
- package/src/color-picker/color-picker.scss +1 -1
- package/src/common-canvas/svg-canvas-d3.scss +20 -16
- package/src/common-properties/components/wide-flyout/wide-flyout.scss +1 -2
- package/src/common-properties/constants/form-constants.js +1 -0
- package/src/common-properties/controls/control-factory.js +6 -1
- package/src/common-properties/controls/controls.scss +1 -0
- package/src/common-properties/controls/slider/index.js +18 -0
- package/src/common-properties/controls/slider/slider.jsx +96 -0
- package/src/common-properties/controls/slider/slider.scss +44 -0
- package/src/common-properties/form/ControlInfo.js +6 -0
- package/src/common-properties/form/EditorForm.js +2 -0
- package/src/common-properties/form/ParameterInfo.js +8 -0
- package/src/common-properties/properties-controller.js +18 -23
- package/src/context-menu/common-context-menu.jsx +15 -1
- package/src/tooltip/tooltip.jsx +14 -2
- package/stats.html +1 -1
- package/dist/canvas-constants-c5e07e1c.js +0 -2
- package/dist/canvas-constants-c5e07e1c.js.map +0 -1
- package/dist/canvas-constants-ef23ad87.js +0 -2
- package/dist/canvas-constants-ef23ad87.js.map +0 -1
- package/dist/canvas-controller-95ecdee5.js +0 -2
- package/dist/canvas-controller-bde80f8a.js +0 -2
- package/dist/common-canvas-32d7e405.js +0 -2
- package/dist/common-canvas-b32c379e.js +0 -2
- package/dist/common-properties-06008d04.js +0 -2
- package/dist/common-properties-06008d04.js.map +0 -1
- package/dist/common-properties-f0e8fedb.js +0 -2
- package/dist/common-properties-f0e8fedb.js.map +0 -1
- package/dist/context-menu-wrapper-96f437f2.js +0 -2
- package/dist/context-menu-wrapper-96f437f2.js.map +0 -1
- package/dist/context-menu-wrapper-a55b8cb4.js +0 -2
- package/dist/context-menu-wrapper-a55b8cb4.js.map +0 -1
- package/dist/datarecord-metadata-v3-schema-76e8fa3e.js +0 -2
- package/dist/datarecord-metadata-v3-schema-9b4a5306.js +0 -2
- package/dist/index-2974f99f.js +0 -2
- package/dist/index-2974f99f.js.map +0 -1
- package/dist/index-86e4c622.js +0 -2
- package/dist/index-86e4c622.js.map +0 -1
|
@@ -77,8 +77,8 @@ $node-port-input-arrow-connected-fill-color: transparent;
|
|
|
77
77
|
// Comment colors
|
|
78
78
|
$comment-outline-color: $active-light-ui;
|
|
79
79
|
$comment-outline-hover-color: $inverse-hover-ui;
|
|
80
|
-
$comment-fill-color: $
|
|
81
|
-
$comment-text-color: $
|
|
80
|
+
$comment-fill-color: $ui-01;
|
|
81
|
+
$comment-text-color: $text-01;
|
|
82
82
|
|
|
83
83
|
// Comment properties
|
|
84
84
|
$comment-text-font-size: 12px;
|
|
@@ -631,13 +631,16 @@ $link-highlight-color: $support-04;
|
|
|
631
631
|
user-select: none;
|
|
632
632
|
}
|
|
633
633
|
|
|
634
|
-
@mixin d3-comment-color-overrides($background-color) {
|
|
634
|
+
@mixin d3-comment-color-overrides($background-color, $text-color) {
|
|
635
635
|
.d3-comment-rect {
|
|
636
636
|
fill: $background-color;
|
|
637
637
|
}
|
|
638
|
+
.d3-comment-text {
|
|
639
|
+
color: $text-color;
|
|
640
|
+
}
|
|
638
641
|
.d3-comment-entry {
|
|
639
642
|
background-color: $background-color;
|
|
640
|
-
color: $
|
|
643
|
+
color: $text-color;
|
|
641
644
|
}
|
|
642
645
|
}
|
|
643
646
|
|
|
@@ -647,40 +650,41 @@ $link-highlight-color: $support-04;
|
|
|
647
650
|
// assumption is, the user would prefer the color they set in the UI to
|
|
648
651
|
// override any color provided by the host app.
|
|
649
652
|
g.bkg-col-white-0 {
|
|
650
|
-
|
|
653
|
+
// In dark-mode, white-0 will be interpreted as black background with white text.
|
|
654
|
+
@include d3-comment-color-overrides($ui-01, $text-01);
|
|
651
655
|
}
|
|
652
656
|
g.bkg-col-yellow-20 {
|
|
653
|
-
@include d3-comment-color-overrides($yellow-20);
|
|
657
|
+
@include d3-comment-color-overrides($yellow-20, $gray-100);
|
|
654
658
|
}
|
|
655
659
|
g.bkg-col-gray-20 {
|
|
656
|
-
@include d3-comment-color-overrides($gray-20);
|
|
660
|
+
@include d3-comment-color-overrides($gray-20, $gray-100);
|
|
657
661
|
}
|
|
658
662
|
g.bkg-col-green-20 {
|
|
659
|
-
@include d3-comment-color-overrides($green-20);
|
|
663
|
+
@include d3-comment-color-overrides($green-20, $gray-100);
|
|
660
664
|
}
|
|
661
665
|
g.bkg-col-teal-20 {
|
|
662
|
-
@include d3-comment-color-overrides($teal-20);
|
|
666
|
+
@include d3-comment-color-overrides($teal-20, $gray-100);
|
|
663
667
|
}
|
|
664
668
|
g.bkg-col-cyan-20 {
|
|
665
|
-
@include d3-comment-color-overrides($cyan-20);
|
|
669
|
+
@include d3-comment-color-overrides($cyan-20, $gray-100);
|
|
666
670
|
}
|
|
667
671
|
g.bkg-col-red-50 {
|
|
668
|
-
@include d3-comment-color-overrides($red-50);
|
|
672
|
+
@include d3-comment-color-overrides($red-50, $gray-100);
|
|
669
673
|
}
|
|
670
674
|
g.bkg-col-orange-40 {
|
|
671
|
-
@include d3-comment-color-overrides($orange-40);
|
|
675
|
+
@include d3-comment-color-overrides($orange-40, $gray-100);
|
|
672
676
|
}
|
|
673
677
|
g.bkg-col-gray-50 {
|
|
674
|
-
@include d3-comment-color-overrides($gray-50);
|
|
678
|
+
@include d3-comment-color-overrides($gray-50, $gray-100);
|
|
675
679
|
}
|
|
676
680
|
g.bkg-col-green-50 {
|
|
677
|
-
@include d3-comment-color-overrides($green-50);
|
|
681
|
+
@include d3-comment-color-overrides($green-50, $gray-100);
|
|
678
682
|
}
|
|
679
683
|
g.bkg-col-teal-50 {
|
|
680
|
-
@include d3-comment-color-overrides($teal-50);
|
|
684
|
+
@include d3-comment-color-overrides($teal-50, $gray-100);
|
|
681
685
|
}
|
|
682
686
|
g.bkg-col-cyan-50 {
|
|
683
|
-
@include d3-comment-color-overrides($cyan-50);
|
|
687
|
+
@include d3-comment-color-overrides($cyan-50, $gray-100);
|
|
684
688
|
}
|
|
685
689
|
|
|
686
690
|
.d3-comment-selection-highlight {
|
|
@@ -48,6 +48,7 @@ import StructureEditorControl from "./structureeditor";
|
|
|
48
48
|
import StructureTableControl from "./structuretable";
|
|
49
49
|
import StructurelisteditorControl from "./structurelisteditor";
|
|
50
50
|
import ReadonlyTableControl from "./readonlytable";
|
|
51
|
+
import Slider from "./slider";
|
|
51
52
|
|
|
52
53
|
import ControlItem from "./../components/control-item";
|
|
53
54
|
import ActionFactory from "./../actions/action-factory.js";
|
|
@@ -82,7 +83,8 @@ const accessibleControls = [
|
|
|
82
83
|
ControlType.ONEOFSELECT,
|
|
83
84
|
ControlType.MULTISELECT,
|
|
84
85
|
ControlType.SELECTSCHEMA,
|
|
85
|
-
ControlType.SELECTCOLUMN
|
|
86
|
+
ControlType.SELECTCOLUMN,
|
|
87
|
+
ControlType.SLIDER
|
|
86
88
|
];
|
|
87
89
|
|
|
88
90
|
const tableControls = [
|
|
@@ -337,6 +339,9 @@ export default class ControlFactory {
|
|
|
337
339
|
rightFlyout={this.rightFlyout}
|
|
338
340
|
/>);
|
|
339
341
|
break;
|
|
342
|
+
case (ControlType.SLIDER):
|
|
343
|
+
createdControl = (<Slider {...props} />);
|
|
344
|
+
break;
|
|
340
345
|
default:
|
|
341
346
|
createdControl = (<ReadonlyControl {...props} />);
|
|
342
347
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-2023 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 Slider from "./slider.jsx";
|
|
18
|
+
export default Slider;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-2023 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 { Slider } from "carbon-components-react";
|
|
20
|
+
import { connect } from "react-redux";
|
|
21
|
+
import classNames from "classnames";
|
|
22
|
+
import { v4 as uuid4 } from "uuid";
|
|
23
|
+
|
|
24
|
+
import * as ControlUtils from "../../util/control-utils";
|
|
25
|
+
import ValidationMessage from "../../components/validation-message";
|
|
26
|
+
import { STATES } from "../../constants/constants";
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class SliderControl extends React.Component {
|
|
30
|
+
constructor(props) {
|
|
31
|
+
super(props);
|
|
32
|
+
this.handleChange = this.handleChange.bind(this);
|
|
33
|
+
this.uuid = uuid4();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
handleChange(e) {
|
|
37
|
+
this.props.controller.updatePropertyValue(this.props.propertyId, e.value);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
render() {
|
|
41
|
+
const minLabel = this.props.controller.getResource(`${this.props.control.name}.min.label`, null);
|
|
42
|
+
const maxLabel = this.props.controller.getResource(`${this.props.control.name}.max.label`, null);
|
|
43
|
+
const minValue = this.props.control.minValue ? this.props.control.minValue : 0;
|
|
44
|
+
const maxValue = this.props.control.maxValue ? this.props.control.maxValue : 10;
|
|
45
|
+
const step = this.props.control.increment ? this.props.control.increment : 1;
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div className={classNames("properties-slider ", { "hide": this.props.state === STATES.HIDDEN },
|
|
49
|
+
this.props.messageInfo ? this.props.messageInfo.type : null)} data-id={ControlUtils.getDataId(this.props.propertyId)}
|
|
50
|
+
>
|
|
51
|
+
<Slider
|
|
52
|
+
value={this.props.value !== null && typeof this.props.value !== "undefined" ? this.props.value : minValue}
|
|
53
|
+
min={minValue}
|
|
54
|
+
max={maxValue}
|
|
55
|
+
minLabel={minLabel}
|
|
56
|
+
maxLabel={maxLabel}
|
|
57
|
+
step={step}
|
|
58
|
+
labelText={this.props.controlItem}
|
|
59
|
+
onChange={this.handleChange}
|
|
60
|
+
disabled={this.props.state === STATES.DISABLED}
|
|
61
|
+
light={this.props.controller.getLight() && this.props.control.light}
|
|
62
|
+
formatLabel={
|
|
63
|
+
(val, label) => label || val
|
|
64
|
+
}
|
|
65
|
+
/>
|
|
66
|
+
<ValidationMessage state={this.props.state} messageInfo={this.props.messageInfo} inTable={this.props.tableControl} />
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
SliderControl.propTypes = {
|
|
73
|
+
control: PropTypes.object.isRequired,
|
|
74
|
+
propertyId: PropTypes.object.isRequired,
|
|
75
|
+
controller: PropTypes.object.isRequired,
|
|
76
|
+
controlItem: PropTypes.oneOfType([
|
|
77
|
+
PropTypes.string,
|
|
78
|
+
PropTypes.element
|
|
79
|
+
]), // list control passes string
|
|
80
|
+
tableControl: PropTypes.bool,
|
|
81
|
+
state: PropTypes.string, // pass in by redux
|
|
82
|
+
value: PropTypes.number, // pass in by redux
|
|
83
|
+
messageInfo: PropTypes.object // pass in by redux
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
const mapStateToProps = (state, ownProps) => ({
|
|
88
|
+
value: ownProps.controller.getPropertyValue(ownProps.propertyId),
|
|
89
|
+
state: ownProps.controller.getControlState(ownProps.propertyId),
|
|
90
|
+
valueStates: ownProps.controller.getControlValueStates(ownProps.propertyId),
|
|
91
|
+
messageInfo: ownProps.controller.getErrorMessage(ownProps.propertyId),
|
|
92
|
+
controlOpts: ownProps.controller.getFilteredEnumItems(ownProps.propertyId, ownProps.control)
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export default connect(mapStateToProps, null)(SliderControl);
|
|
96
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2017-2023 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-slider {
|
|
18
|
+
.bx--slider-container {
|
|
19
|
+
min-width: 100%;
|
|
20
|
+
|
|
21
|
+
.bx--slider {
|
|
22
|
+
min-width: unset; // Default Carbon Component Slider has a fixed min-width of 12.5rem so unset it to make it responsive
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
&.error {
|
|
26
|
+
.bx--text-input--invalid, .bx--text-input {
|
|
27
|
+
outline: unset;
|
|
28
|
+
outline-offset: unset;
|
|
29
|
+
}
|
|
30
|
+
input[type="number"]:not([disabled]) {
|
|
31
|
+
border: 2px solid $support-01;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
&.warning {
|
|
35
|
+
.bx--text-input--invalid, .bx--text-input {
|
|
36
|
+
outline: unset;
|
|
37
|
+
outline-offset: unset;
|
|
38
|
+
}
|
|
39
|
+
input[type="number"]:not([disabled]) {
|
|
40
|
+
border: 2px solid $support-03;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}
|
|
@@ -82,6 +82,12 @@ export class Control {
|
|
|
82
82
|
if (settings.increment) {
|
|
83
83
|
this.increment = settings.increment;
|
|
84
84
|
}
|
|
85
|
+
if (settings.minValue) {
|
|
86
|
+
this.minValue = settings.minValue;
|
|
87
|
+
}
|
|
88
|
+
if (settings.maxValue) {
|
|
89
|
+
this.maxValue = settings.maxValue;
|
|
90
|
+
}
|
|
85
91
|
if (settings.generatedValues) {
|
|
86
92
|
this.generatedValues = {};
|
|
87
93
|
if (settings.generatedValues.operation) {
|
|
@@ -636,6 +636,8 @@ function _makeControl(parameterMetadata, paramName, group, structureDefinition,
|
|
|
636
636
|
settings.enableMaximize = parameter.enableMaximize;
|
|
637
637
|
settings.summary = parameter.summary;
|
|
638
638
|
settings.increment = parameter.increment;
|
|
639
|
+
settings.minValue = parameter.minValue;
|
|
640
|
+
settings.maxValue = parameter.maxValue;
|
|
639
641
|
settings.rowSelection = rowSelection;
|
|
640
642
|
settings.generatedValues = parameter.generatedValues;
|
|
641
643
|
settings.addRemoveRows = addRemoveRows;
|
|
@@ -65,6 +65,12 @@ export class ParameterDef {
|
|
|
65
65
|
if (settings.charLimit) {
|
|
66
66
|
this.charLimit = settings.charLimit;
|
|
67
67
|
}
|
|
68
|
+
if (settings.minValue) {
|
|
69
|
+
this.minValue = settings.minValue;
|
|
70
|
+
}
|
|
71
|
+
if (settings.maxValue) {
|
|
72
|
+
this.maxValue = settings.maxValue;
|
|
73
|
+
}
|
|
68
74
|
if (settings.placeHolderText) {
|
|
69
75
|
this.placeHolderText = ResourceDef.make(settings.placeHolderText);
|
|
70
76
|
}
|
|
@@ -330,6 +336,8 @@ export class ParameterDef {
|
|
|
330
336
|
"orientation": propertyOf(uihint)("orientation"),
|
|
331
337
|
"width": propertyOf(uihint)("width"),
|
|
332
338
|
"charLimit": propertyOf(uihint)("char_limit"),
|
|
339
|
+
"minValue": propertyOf(uihint)("min_value"),
|
|
340
|
+
"maxValue": propertyOf(uihint)("max_value"),
|
|
333
341
|
"placeHolderText": propertyOf(uihint)("place_holder_text"),
|
|
334
342
|
"separator": propertyOf(uihint)("separator"),
|
|
335
343
|
"resource_key": propertyOf(uihint)("resource_key"),
|
|
@@ -28,7 +28,7 @@ import { STATES, ACTIONS, CONDITION_TYPE, PANEL_TREE_ROOT, CONDITION_MESSAGE_TYP
|
|
|
28
28
|
import CommandStack from "../command-stack/command-stack.js";
|
|
29
29
|
import ControlFactory from "./controls/control-factory";
|
|
30
30
|
import { Type, ParamRole, ControlType, ItemType } from "./constants/form-constants";
|
|
31
|
-
import { has, cloneDeep, assign, isEmpty, isEqual, isUndefined, get, difference } from "lodash";
|
|
31
|
+
import { has, cloneDeep, assign, isEmpty, isEqual, isUndefined, get, difference, merge } from "lodash";
|
|
32
32
|
import Form from "./form/Form";
|
|
33
33
|
import { getConditionOps } from "./ui-conditions/condition-ops/condition-ops";
|
|
34
34
|
import { DEFAULT_LOCALE } from "./constants/constants";
|
|
@@ -395,7 +395,7 @@ export default class PropertiesController {
|
|
|
395
395
|
parseUiContent(this.panelTree, this.form, PANEL_TREE_ROOT);
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
-
_addToControlValues(sameParameterDefRendered, resolveParameterRefs,
|
|
398
|
+
_addToControlValues(sameParameterDefRendered, resolveParameterRefs, setDefaults) {
|
|
399
399
|
const defaultControlValues = {};
|
|
400
400
|
for (const keyName in this.controls) {
|
|
401
401
|
if (!has(this.controls, keyName)) {
|
|
@@ -403,7 +403,12 @@ export default class PropertiesController {
|
|
|
403
403
|
}
|
|
404
404
|
const control = this.controls[keyName];
|
|
405
405
|
const propertyId = { name: control.name };
|
|
406
|
-
let controlValue
|
|
406
|
+
let controlValue;
|
|
407
|
+
if (setDefaults?.values) {
|
|
408
|
+
controlValue = setDefaults.values[control.name];
|
|
409
|
+
} else {
|
|
410
|
+
controlValue = this.getPropertyValue(propertyId);
|
|
411
|
+
}
|
|
407
412
|
|
|
408
413
|
if (resolveParameterRefs) {
|
|
409
414
|
if (typeof controlValue !== "undefined" && controlValue !== null && typeof controlValue.parameterRef !== "undefined") {
|
|
@@ -422,7 +427,7 @@ export default class PropertiesController {
|
|
|
422
427
|
controlValue = PropertyUtils.convertObjectStructureToArray(control.valueDef.isList, control.subControls, controlValue);
|
|
423
428
|
}
|
|
424
429
|
|
|
425
|
-
if (setDefaultValues) {
|
|
430
|
+
if (setDefaults?.setDefaultValues) {
|
|
426
431
|
// When setDefaultValues is set, update all default values in a single call
|
|
427
432
|
defaultControlValues[control.name] = controlValue;
|
|
428
433
|
} else if (sameParameterDefRendered && !this.differentProperties.includes(control.name)) {
|
|
@@ -440,23 +445,11 @@ export default class PropertiesController {
|
|
|
440
445
|
}
|
|
441
446
|
}
|
|
442
447
|
|
|
443
|
-
if (setDefaultValues) {
|
|
444
|
-
|
|
448
|
+
if (setDefaults?.setDefaultValues) {
|
|
449
|
+
return defaultControlValues;
|
|
445
450
|
}
|
|
446
|
-
}
|
|
447
451
|
|
|
448
|
-
|
|
449
|
-
// Update all default values
|
|
450
|
-
this.propertiesStore.setPropertyValues(defaultControlValues);
|
|
451
|
-
|
|
452
|
-
// Single call to the propertyListener
|
|
453
|
-
if (this.handlers.propertyListener) {
|
|
454
|
-
this.handlers.propertyListener(
|
|
455
|
-
{
|
|
456
|
-
action: ACTIONS.SET_PROPERTIES // Setting the default control values
|
|
457
|
-
}
|
|
458
|
-
);
|
|
459
|
-
}
|
|
452
|
+
return null;
|
|
460
453
|
}
|
|
461
454
|
|
|
462
455
|
_populateFieldData(controlValue, control) {
|
|
@@ -1254,6 +1247,12 @@ export default class PropertiesController {
|
|
|
1254
1247
|
}
|
|
1255
1248
|
}
|
|
1256
1249
|
|
|
1250
|
+
if (options && options.setDefaultValues) {
|
|
1251
|
+
const setDefaults = { values: inValues, setDefaultValues: true };
|
|
1252
|
+
const defaultValues = this._addToControlValues(false, false, setDefaults);
|
|
1253
|
+
inValues = merge(defaultValues, inValues);
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1257
1256
|
this.propertiesStore.setPropertyValues(inValues);
|
|
1258
1257
|
|
|
1259
1258
|
if (options && options.isInitProps) {
|
|
@@ -1291,10 +1290,6 @@ export default class PropertiesController {
|
|
|
1291
1290
|
}
|
|
1292
1291
|
);
|
|
1293
1292
|
}
|
|
1294
|
-
|
|
1295
|
-
if (options && options.setDefaultValues) {
|
|
1296
|
-
this._addToControlValues(false, false, true);
|
|
1297
|
-
}
|
|
1298
1293
|
}
|
|
1299
1294
|
|
|
1300
1295
|
/**
|
|
@@ -258,6 +258,19 @@ class CommonContextMenu extends React.Component {
|
|
|
258
258
|
return subMenuPosStyle;
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
+
// Returns the menu definition array passed in making sure any
|
|
262
|
+
// submenu items have an action. Note: some applications forget
|
|
263
|
+
// to do provide an action because for the submenu it is only
|
|
264
|
+
// used by the context menu code.
|
|
265
|
+
ensureAllSubMenuItemsHaveAction(menuDef) {
|
|
266
|
+
return menuDef.map((item, index) => {
|
|
267
|
+
if (item.submenu && typeof item.action === "undefined") {
|
|
268
|
+
return { ...item, action: "submenu_" + index };
|
|
269
|
+
}
|
|
270
|
+
return item;
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
261
274
|
render() {
|
|
262
275
|
// Reposition contextMenu so that it does not show off the screen
|
|
263
276
|
const menuSize = this.calculateMenuSize(this.props.menuDefinition);
|
|
@@ -267,7 +280,8 @@ class CommonContextMenu extends React.Component {
|
|
|
267
280
|
top: menuPos.y + "px"
|
|
268
281
|
};
|
|
269
282
|
|
|
270
|
-
const
|
|
283
|
+
const menuDefinition = this.ensureAllSubMenuItemsHaveAction(this.props.menuDefinition);
|
|
284
|
+
const menuItems = this.buildMenu(menuDefinition, menuSize, menuPos, this.props.canvasRect);
|
|
271
285
|
|
|
272
286
|
return (
|
|
273
287
|
<div id="context-menu-popover" className="context-menu-popover" style={posStyle} onContextMenu={this.onContextMenu}>
|
package/src/tooltip/tooltip.jsx
CHANGED
|
@@ -32,6 +32,7 @@ class ToolTip extends React.Component {
|
|
|
32
32
|
this.uuid = uuid4();
|
|
33
33
|
this.pendingTooltip = null;
|
|
34
34
|
this.hideTooltipOnScrollAndResize = this.hideTooltipOnScrollAndResize.bind(this);
|
|
35
|
+
this.tabKeyPressed = false;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
componentDidMount() {
|
|
@@ -82,6 +83,12 @@ class ToolTip extends React.Component {
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
|
|
86
|
+
setKeyPressed(evt) {
|
|
87
|
+
if (evt.key === "Tab") {
|
|
88
|
+
this.tabKeyPressed = true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
85
92
|
getStyleValue(value) {
|
|
86
93
|
return value + "px";
|
|
87
94
|
}
|
|
@@ -337,10 +344,14 @@ class ToolTip extends React.Component {
|
|
|
337
344
|
const mousedown = () => this.setTooltipVisible(false);
|
|
338
345
|
// `focus` event occurs before `click`. Adding timeout in onFocus function to ensure click is executed first.
|
|
339
346
|
// Ref - https://stackoverflow.com/a/49512400
|
|
347
|
+
const onKeyDown = (evt) => this.setKeyPressed(evt);
|
|
340
348
|
const onFocus = () => this.showTooltipWithDelay();
|
|
341
349
|
const onBlur = (evt) => {
|
|
342
|
-
//
|
|
343
|
-
if (
|
|
350
|
+
// Close the tooltip if tab is click
|
|
351
|
+
if (this.tabKeyPressed) {
|
|
352
|
+
this.setTooltipVisible(false);
|
|
353
|
+
this.tabKeyPressed = false;
|
|
354
|
+
} else if (evt.relatedTarget === null) { // Keep tooltip visible when clicked on a link.
|
|
344
355
|
this.setTooltipVisible(false);
|
|
345
356
|
}
|
|
346
357
|
};
|
|
@@ -355,6 +366,7 @@ class ToolTip extends React.Component {
|
|
|
355
366
|
onClick={this.props.showToolTipOnClick ? click : null}
|
|
356
367
|
onFocus={this.props.showToolTipOnClick ? onFocus : null} // When focused using keyboard
|
|
357
368
|
onBlur={this.props.showToolTipOnClick ? onBlur : null}
|
|
369
|
+
onKeyDown={this.props.showToolTipOnClick ? onKeyDown : null}
|
|
358
370
|
tabIndex={this.props.showToolTipOnClick ? 0 : null}
|
|
359
371
|
role={this.props.showToolTipOnClick ? "button" : null}
|
|
360
372
|
aria-labelledby={this.props.showToolTipOnClick ? `${this.uuid}-${this.props.id}` : null}
|