@elyra/canvas 12.27.1 → 12.28.1

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.
Files changed (181) hide show
  1. package/dist/{canvas-constants-07dbe4b7.js → canvas-constants-046e4126.js} +2 -2
  2. package/dist/{canvas-constants-07dbe4b7.js.map → canvas-constants-046e4126.js.map} +1 -1
  3. package/dist/canvas-constants-f4e65d4d.js +2 -0
  4. package/dist/canvas-constants-f4e65d4d.js.map +1 -0
  5. package/dist/{canvas-controller-01c28c3a.js → canvas-controller-1bbd9c0e.js} +2 -2
  6. package/dist/canvas-controller-1bbd9c0e.js.map +1 -0
  7. package/dist/canvas-controller-d6aa7d4d.js +2 -0
  8. package/dist/canvas-controller-d6aa7d4d.js.map +1 -0
  9. package/dist/common-canvas-9c735f47.js +2 -0
  10. package/dist/common-canvas-9c735f47.js.map +1 -0
  11. package/dist/common-canvas-a02e75c1.js +2 -0
  12. package/dist/common-canvas-a02e75c1.js.map +1 -0
  13. package/dist/common-canvas.es.js +1 -1
  14. package/dist/common-canvas.js +1 -1
  15. package/dist/common-properties-3b9f3106.js +2 -0
  16. package/dist/common-properties-3b9f3106.js.map +1 -0
  17. package/dist/common-properties-86b9b936.js +2 -0
  18. package/dist/common-properties-86b9b936.js.map +1 -0
  19. package/dist/datarecord-metadata-v3-schema-6a3754ce.js +1 -1
  20. package/dist/datarecord-metadata-v3-schema-6a3754ce.js.map +1 -1
  21. package/dist/datarecord-metadata-v3-schema-ba1f2849.js +1 -1
  22. package/dist/datarecord-metadata-v3-schema-ba1f2849.js.map +1 -1
  23. package/dist/en-7201b548.js +1 -1
  24. package/dist/en-7201b548.js.map +1 -1
  25. package/dist/en-a08356c8.js +1 -1
  26. package/dist/en-a08356c8.js.map +1 -1
  27. package/dist/{extends-de3127ea.js → extends-7d4f15b6.js} +2 -2
  28. package/dist/extends-7d4f15b6.js.map +1 -0
  29. package/dist/extends-d144eab9.js +7 -0
  30. package/dist/extends-d144eab9.js.map +1 -0
  31. package/dist/flexible-table-8219d7a0.js +2 -0
  32. package/dist/flexible-table-8219d7a0.js.map +1 -0
  33. package/dist/flexible-table-f5d55fe4.js +2 -0
  34. package/dist/flexible-table-f5d55fe4.js.map +1 -0
  35. package/dist/{icon-63afae46.js → icon-221bb2e5.js} +2 -2
  36. package/dist/{icon-63afae46.js.map → icon-221bb2e5.js.map} +1 -1
  37. package/dist/icon-ea917a08.js +2 -0
  38. package/dist/{icon-94bf4b86.js.map → icon-ea917a08.js.map} +1 -1
  39. package/dist/index-17b33a9b.js +2 -0
  40. package/dist/index-17b33a9b.js.map +1 -0
  41. package/dist/index-ac265f1e.js +2 -0
  42. package/dist/index-ac265f1e.js.map +1 -0
  43. package/dist/isArrayLikeObject-a9c7973b.js +1 -1
  44. package/dist/isArrayLikeObject-a9c7973b.js.map +1 -1
  45. package/dist/isArrayLikeObject-f3b27f64.js +1 -1
  46. package/dist/isArrayLikeObject-f3b27f64.js.map +1 -1
  47. package/dist/lib/canvas-controller.es.js +1 -1
  48. package/dist/lib/canvas-controller.js +1 -1
  49. package/dist/lib/canvas.es.js +1 -1
  50. package/dist/lib/canvas.js +1 -1
  51. package/dist/lib/context-menu.es.js +1 -1
  52. package/dist/lib/context-menu.js +1 -1
  53. package/dist/lib/properties/field-picker.es.js +1 -1
  54. package/dist/lib/properties/field-picker.js +1 -1
  55. package/dist/lib/properties/flexible-table.es.js +1 -1
  56. package/dist/lib/properties/flexible-table.js +1 -1
  57. package/dist/lib/properties.es.js +1 -1
  58. package/dist/lib/properties.js +1 -1
  59. package/dist/lib/tooltip.es.js +1 -1
  60. package/dist/lib/tooltip.es.js.map +1 -1
  61. package/dist/lib/tooltip.js +1 -1
  62. package/dist/lib/tooltip.js.map +1 -1
  63. package/dist/styles/common-canvas.min.css +1 -1
  64. package/dist/styles/common-canvas.min.css.map +1 -1
  65. package/dist/toolbar-2bbc9542.js +2 -0
  66. package/dist/toolbar-2bbc9542.js.map +1 -0
  67. package/dist/toolbar-c173e22a.js +2 -0
  68. package/dist/toolbar-c173e22a.js.map +1 -0
  69. package/locales/common-properties/locales/de.json +2 -1
  70. package/locales/common-properties/locales/en.json +2 -0
  71. package/locales/common-properties/locales/eo.json +2 -0
  72. package/locales/common-properties/locales/es.json +3 -2
  73. package/locales/common-properties/locales/fr.json +2 -1
  74. package/locales/common-properties/locales/it.json +2 -1
  75. package/locales/common-properties/locales/ja.json +2 -1
  76. package/locales/common-properties/locales/ko.json +2 -1
  77. package/locales/common-properties/locales/pt-br.json +2 -1
  78. package/locales/common-properties/locales/sv.json +2 -1
  79. package/locales/common-properties/locales/zh-CN.json +5 -4
  80. package/locales/common-properties/locales/zh-TW.json +2 -1
  81. package/locales/notification-panel/locales/de.json +3 -0
  82. package/locales/notification-panel/locales/es.json +3 -0
  83. package/locales/notification-panel/locales/fr.json +3 -0
  84. package/locales/notification-panel/locales/it.json +3 -0
  85. package/locales/notification-panel/locales/ja.json +3 -0
  86. package/locales/notification-panel/locales/ko.json +3 -0
  87. package/locales/notification-panel/locales/pt-BR.json +3 -0
  88. package/locales/notification-panel/locales/sv.json +3 -0
  89. package/locales/notification-panel/locales/zh-CN.json +3 -0
  90. package/locales/notification-panel/locales/zh-TW.json +3 -0
  91. package/package.json +1 -1
  92. package/src/common-canvas/canvas-controller.js +31 -0
  93. package/src/common-canvas/cc-toolbar.jsx +5 -5
  94. package/src/common-canvas/constants/canvas-constants.js +2 -0
  95. package/src/common-canvas/svg-canvas-renderer.js +29 -14
  96. package/src/common-properties/actions/button/button.jsx +1 -3
  97. package/src/common-properties/actions/image/image.jsx +1 -3
  98. package/src/common-properties/common-properties.jsx +8 -5
  99. package/src/common-properties/components/control-item/control-item.jsx +1 -3
  100. package/src/common-properties/components/control-item/control-item.scss +2 -0
  101. package/src/common-properties/components/field-picker/field-picker.jsx +1 -3
  102. package/src/common-properties/components/truncated-content-tooltip/truncated-content-tooltip.jsx +11 -3
  103. package/src/common-properties/components/truncated-content-tooltip/truncated-content-tooltip.scss +1 -1
  104. package/src/common-properties/components/validation-message/validation-message.jsx +1 -2
  105. package/src/common-properties/components/virtualized-table/virtualized-table.jsx +18 -31
  106. package/src/common-properties/constants/constants.js +12 -1
  107. package/src/common-properties/constants/form-constants.js +2 -0
  108. package/src/common-properties/controls/abstract-table.jsx +7 -4
  109. package/src/common-properties/controls/checkbox/checkbox.jsx +1 -2
  110. package/src/common-properties/controls/checkboxset/checkboxset.jsx +1 -1
  111. package/src/common-properties/controls/control-factory.js +10 -0
  112. package/src/common-properties/controls/controls.scss +3 -1
  113. package/src/common-properties/controls/datepicker/datepicker.jsx +118 -0
  114. package/src/common-properties/controls/datepicker/datepicker.scss +23 -0
  115. package/src/common-properties/controls/datepicker/index.js +18 -0
  116. package/src/common-properties/controls/datepicker-range/datepicker-range.jsx +194 -0
  117. package/src/common-properties/controls/datepicker-range/datepicker-range.scss +21 -0
  118. package/src/common-properties/controls/datepicker-range/index.js +18 -0
  119. package/src/common-properties/controls/dropdown/dropdown.jsx +2 -1
  120. package/src/common-properties/controls/expression/expression-builder/expression-select-field-function.jsx +3 -2
  121. package/src/common-properties/controls/expression/expression-builder/expression-select-operator.jsx +1 -3
  122. package/src/common-properties/controls/radioset/radioset.jsx +1 -1
  123. package/src/common-properties/controls/readonly/readonly.jsx +7 -0
  124. package/src/common-properties/controls/textarea/textarea.jsx +3 -2
  125. package/src/common-properties/controls/textfield/textfield.jsx +15 -17
  126. package/src/common-properties/controls/textfield/textfield.scss +1 -0
  127. package/src/common-properties/form/EditorForm.js +5 -1
  128. package/src/common-properties/form/Form.js +2 -8
  129. package/src/common-properties/panels/sub-panel/cell.jsx +1 -2
  130. package/src/common-properties/panels/summary/summary.jsx +12 -12
  131. package/src/common-properties/panels/summary/summary.scss +4 -10
  132. package/src/common-properties/properties-controller.js +15 -6
  133. package/src/common-properties/properties-main/properties-main.jsx +11 -3
  134. package/src/common-properties/ui-conditions/condition-ops/contains.js +1 -1
  135. package/src/common-properties/ui-conditions/condition-ops/greaterThan.js +22 -1
  136. package/src/common-properties/ui-conditions/condition-ops/isDateTime.js +9 -6
  137. package/src/common-properties/ui-conditions/condition-ops/isEmpty.js +7 -1
  138. package/src/common-properties/ui-conditions/condition-ops/isNotEmpty.js +5 -1
  139. package/src/common-properties/ui-conditions/condition-ops/lessThan.js +22 -1
  140. package/src/common-properties/ui-conditions/condition-ops/notContains.js +1 -1
  141. package/src/common-properties/ui-conditions/conditions-utils.js +5 -5
  142. package/src/common-properties/util/control-utils.js +18 -3
  143. package/src/common-properties/util/date-utils.js +152 -0
  144. package/src/common-properties/util/property-utils.js +29 -12
  145. package/src/object-model/api-pipeline.js +1 -0
  146. package/src/object-model/object-model.js +12 -0
  147. package/src/object-model/redux/reducers/canvasinfo.js +8 -0
  148. package/src/themes/light.scss +16 -0
  149. package/src/toolbar/toolbar-action-item.jsx +9 -7
  150. package/src/tooltip/tooltip.jsx +28 -15
  151. package/src/tooltip/tooltip.scss +7 -7
  152. package/stats.html +1 -1
  153. package/dist/canvas-constants-ba465147.js +0 -2
  154. package/dist/canvas-constants-ba465147.js.map +0 -1
  155. package/dist/canvas-controller-01c28c3a.js.map +0 -1
  156. package/dist/canvas-controller-fc5bee30.js +0 -2
  157. package/dist/canvas-controller-fc5bee30.js.map +0 -1
  158. package/dist/common-canvas-4f99983f.js +0 -2
  159. package/dist/common-canvas-4f99983f.js.map +0 -1
  160. package/dist/common-canvas-e1879d85.js +0 -2
  161. package/dist/common-canvas-e1879d85.js.map +0 -1
  162. package/dist/common-properties-9a5037f4.js +0 -2
  163. package/dist/common-properties-9a5037f4.js.map +0 -1
  164. package/dist/common-properties-cae41b08.js +0 -2
  165. package/dist/common-properties-cae41b08.js.map +0 -1
  166. package/dist/extends-86f8d713.js +0 -7
  167. package/dist/extends-86f8d713.js.map +0 -1
  168. package/dist/extends-de3127ea.js.map +0 -1
  169. package/dist/flexible-table-d68c24c6.js +0 -2
  170. package/dist/flexible-table-d68c24c6.js.map +0 -1
  171. package/dist/flexible-table-f14863ac.js +0 -2
  172. package/dist/flexible-table-f14863ac.js.map +0 -1
  173. package/dist/icon-94bf4b86.js +0 -2
  174. package/dist/index-5c0ad9bb.js +0 -2
  175. package/dist/index-5c0ad9bb.js.map +0 -1
  176. package/dist/index-fc1b32b4.js +0 -2
  177. package/dist/index-fc1b32b4.js.map +0 -1
  178. package/dist/toolbar-393d299e.js +0 -2
  179. package/dist/toolbar-393d299e.js.map +0 -1
  180. package/dist/toolbar-91001066.js +0 -2
  181. package/dist/toolbar-91001066.js.map +0 -1
@@ -24,10 +24,11 @@ import * as ControlUtils from "./../../util/control-utils";
24
24
  import { formatMessage } from "./../../util/property-utils";
25
25
  import { STATES } from "./../../constants/constants.js";
26
26
  import { CONDITION_MESSAGE_TYPE, MESSAGE_KEYS, TRUNCATE_LIMIT } from "./../../constants/constants.js";
27
- import Tooltip from "./../../../tooltip/tooltip.jsx";
27
+ import TruncatedContentTooltip from "./../../components/truncated-content-tooltip";
28
28
  import classNames from "classnames";
29
29
  import { v4 as uuid4 } from "uuid";
30
30
 
31
+
31
32
  const arrayValueDelimiter = ", ";
32
33
 
33
34
  class TextfieldControl extends React.Component {
@@ -35,7 +36,8 @@ class TextfieldControl extends React.Component {
35
36
  super(props);
36
37
  this.reactIntl = props.controller.getReactIntl();
37
38
  this.charLimit = ControlUtils.getCharLimit(props.control, props.controller.getMaxLengthForSingleLineControls());
38
- this.id = ControlUtils.getControlId(props.propertyId);
39
+ this.uuid = uuid4();
40
+ this.id = ControlUtils.getControlId(props.propertyId, this.uuid);
39
41
  this.isList = false;
40
42
  if (this.props.control.valueDef) {
41
43
  if (this.props.control.valueDef.isList) {
@@ -104,30 +106,26 @@ class TextfieldControl extends React.Component {
104
106
  labelText={this.props.controlItem}
105
107
  hideLabel={this.props.tableControl}
106
108
  light={this.props.controller.getLight() && this.props.control.light}
109
+ ref={(ref) => (this.textInputRef = ref)}
107
110
  />);
108
111
  }
109
112
 
110
113
  let display = textInput;
111
114
  if (this.props.tableControl) {
112
- const tooltipId = uuid4() + "-tooltip-column-" + this.props.propertyId.toString();
115
+ const tooltipProps = {};
116
+ if (this.textInputRef) {
117
+ tooltipProps.truncatedRef = this.textInputRef;
118
+ }
113
119
  let disabled = true;
114
120
  if (value && this.props.state !== STATES.DISABLED) {
115
121
  disabled = false;
116
122
  }
117
- const tooltip = (
118
- <div className="properties-tooltips">
119
- {String(value)}
120
- </div>
121
- );
122
- display = (<Tooltip
123
- id={tooltipId}
124
- tip={tooltip}
125
- direction="bottom"
126
- className="properties-tooltips"
127
- disable={disabled}
128
- >
129
- {textInput}
130
- </Tooltip>);
123
+ display = (<TruncatedContentTooltip
124
+ {...tooltipProps}
125
+ content={textInput}
126
+ tooltipText={value}
127
+ disabled={disabled}
128
+ />);
131
129
  }
132
130
  return (
133
131
  <div className={className} data-id={ControlUtils.getDataId(this.props.propertyId)}>
@@ -39,6 +39,7 @@ $textinput-bottom-padding: 5px;
39
39
  margin: 0;
40
40
  padding: 0;
41
41
  height: 1.72rem;
42
+ text-overflow: ellipsis;
42
43
  &:focus {
43
44
  border-top: 0;
44
45
  border-right: 0;
@@ -490,7 +490,11 @@ function _makeControl(parameterMetadata, paramName, group, structureDefinition,
490
490
  break;
491
491
  case Type.DATE:
492
492
  role = Type.DATE;
493
- if (parameter.isList()) {
493
+ if (parameter.control === ControlType.DATEPICKER) {
494
+ controlType = ControlType.DATEPICKER;
495
+ } else if (parameter.control === ControlType.DATEPICKERRANGE) {
496
+ controlType = ControlType.DATEPICKERRANGE;
497
+ } else if (parameter.isList()) {
494
498
  controlType = ControlType.TEXTAREA;
495
499
  } else {
496
500
  controlType = ControlType.DATEFIELD;
@@ -20,7 +20,6 @@ import { makePrimaryTab } from "./EditorForm";
20
20
  import { UIItem } from "./UIItem";
21
21
  import { L10nProvider } from "../util/L10nProvider";
22
22
  import { translateMessages } from "./Conditions";
23
- import { convertValueDataTypes } from "../util/property-utils";
24
23
  import { Size } from "../constants/form-constants";
25
24
  import { CONTAINER_TYPE } from "../constants/constants";
26
25
 
@@ -45,9 +44,8 @@ export default class Form {
45
44
  * Returns a new Form
46
45
  * @param paramDef Parameter definition
47
46
  * @param containerType Type of container common properties will be displayed in, set in propertiesConfig
48
- * @param shouldConvertValueDataTypes Boolean, if true, convert the currentParameters values into the type defined in parameterDef
49
47
  */
50
- static makeForm(paramDef, containerType, shouldConvertValueDataTypes) {
48
+ static makeForm(paramDef, containerType) {
51
49
  const propDef = PropertyDef.makePropertyDef(propertyOf(paramDef)("titleDefinition"), propertyOf(paramDef)("parameters"), propertyOf(paramDef)("complex_types"),
52
50
  propertyOf(paramDef)("uihints"));
53
51
  const resources = propertyOf(paramDef)("resources");
@@ -61,11 +59,7 @@ export default class Form {
61
59
  }
62
60
  }
63
61
 
64
- let currentParameters = propertyOf(paramDef)("current_parameters");
65
- if (shouldConvertValueDataTypes) {
66
- currentParameters = convertValueDataTypes(currentParameters, propDef.parameterMetadata.paramDefs);
67
- }
68
-
62
+ const currentParameters = propertyOf(paramDef)("current_parameters");
69
63
  const data = {
70
64
  currentParameters: currentParameters,
71
65
  uiCurrentParameters: propertyOf(paramDef)("current_ui_parameters"),
@@ -18,7 +18,6 @@ import React from "react";
18
18
  import PropTypes from "prop-types";
19
19
  import { Button } from "carbon-components-react";
20
20
  import { Settings16 } from "@carbon/icons-react";
21
- import { v4 as uuid4 } from "uuid";
22
21
  import { formatMessage } from "./../../util/property-utils";
23
22
  import Tooltip from "./../../../tooltip/tooltip.jsx";
24
23
  import { cloneDeep } from "lodash";
@@ -68,7 +67,7 @@ export default class SubPanelCell extends React.Component {
68
67
  controller={this.props.controller}
69
68
  >
70
69
  <Tooltip
71
- id={uuid4() + "-" + tooltipId}
70
+ id={tooltipId}
72
71
  tip={subPanelToolTip}
73
72
  direction="left"
74
73
  className="properties-tooltips icon-tooltip"
@@ -27,12 +27,12 @@ import { isEmpty } from "lodash";
27
27
  import * as PropertyUtils from "./../../util/property-utils";
28
28
  import * as ControlUtils from "./../../util/control-utils";
29
29
  import { MESSAGE_KEYS, CONDITION_MESSAGE_TYPE } from "./../../constants/constants";
30
- import { v4 as uuid4 } from "uuid";
31
30
  import { STATES } from "./../../constants/constants.js";
32
31
  import { Type, ParamRole } from "./../../constants/form-constants.js";
33
32
  import classNames from "classnames";
34
33
 
35
34
  import Tooltip from "./../../../tooltip/tooltip.jsx";
35
+ import TruncatedContentTooltip from "../../components/truncated-content-tooltip";
36
36
 
37
37
  class SummaryPanel extends React.Component {
38
38
  constructor(props) {
@@ -45,9 +45,6 @@ class SummaryPanel extends React.Component {
45
45
  this.cancelWideFlyout = this.cancelWideFlyout.bind(this);
46
46
  this._getSummaryTables = this._getSummaryTables.bind(this);
47
47
  }
48
- _onMouseMove(evt) {
49
- this.setState({ mousePos: { x: evt.clientX, y: evt.clientY } });
50
- }
51
48
 
52
49
  hideWideFlyout() {
53
50
  this.props.controller.setIsSummaryPanelShowing(false);
@@ -137,11 +134,12 @@ class SummaryPanel extends React.Component {
137
134
  <td key={"summary-table-data-" + colIdx}
138
135
  className={"properties-summary-row-data "}
139
136
  style={{ width: colWidth }}
140
- onMouseMove={this._onMouseMove.bind(this)}
141
137
  >
142
- <Tooltip id={uuid4()} tip={contentValue} mousePos={this.state.mousePos} showToolTipIfTruncated>
143
- <span id={"span_" + uuid4()}>{contentValue}</span>
144
- </Tooltip>
138
+ <TruncatedContentTooltip
139
+ content={<span>{contentValue}</span>}
140
+ tooltipText={contentValue}
141
+ disabled={false}
142
+ />
145
143
  </td>);
146
144
  }
147
145
  }
@@ -149,9 +147,11 @@ class SummaryPanel extends React.Component {
149
147
  const displayValue = this._getSummaryDisplayValue(rowValue, propertyId);
150
148
  rowData.push(
151
149
  <td key={"summary-table-row-data-" + rowIdx} className={"properties-summary-row-data "}>
152
- <Tooltip id={uuid4()} tip={displayValue} mousePos={this.state.mousePos} showToolTipIfTruncated>
153
- <span id={"span_" + uuid4()}>{displayValue}</span>
154
- </Tooltip>
150
+ <TruncatedContentTooltip
151
+ content={<span>{displayValue}</span>}
152
+ tooltipText={displayValue}
153
+ disabled={false}
154
+ />
155
155
  </td>);
156
156
  }
157
157
  if (rowData.length > 0) {
@@ -264,7 +264,7 @@ class SummaryPanel extends React.Component {
264
264
 
265
265
  return (
266
266
  <Tooltip
267
- id= {uuid4() + "summary-icon"}
267
+ id= "summary-icon"
268
268
  tip={descriptionText}
269
269
  className="properties-tooltips"
270
270
  >
@@ -56,17 +56,11 @@
56
56
  margin-bottom: $spacing-05;
57
57
  }
58
58
 
59
- .properties-summary-row-data > .tooltip-container {
60
- margin: 1px 0;
61
- > div:first-child {
62
- text-overflow: ellipsis;
63
- white-space: nowrap;
64
- overflow: hidden;
65
- }
66
- }
67
-
68
59
  .properties-summary-row {
69
60
  display: flex;
70
- justify-content: space-between;
71
61
  padding: 2px 0;
62
+ span {
63
+ cursor: text;
64
+ user-select: text;
65
+ }
72
66
  }
@@ -27,11 +27,11 @@ import * as PropertyUtils from "./util/property-utils.js";
27
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
- import { Type, ParamRole, ControlType } from "./constants/form-constants";
30
+ import { Type, ParamRole, ControlType, ItemType } from "./constants/form-constants";
31
31
  import { has, cloneDeep, assign, isEmpty, isEqual, isUndefined, get } from "lodash";
32
32
  import Form from "./form/Form";
33
33
  import { getConditionOps } from "./ui-conditions/condition-ops/condition-ops";
34
- import { ItemType } from "./constants/form-constants";
34
+ import { DEFAULT_LOCALE } from "./constants/constants";
35
35
  export default class PropertiesController {
36
36
 
37
37
  constructor() {
@@ -126,6 +126,10 @@ export default class PropertiesController {
126
126
  return this.propertiesConfig;
127
127
  }
128
128
 
129
+ getLocale() {
130
+ return get(this.propertiesConfig, "locale", DEFAULT_LOCALE);
131
+ }
132
+
129
133
  isTearsheetContainer() {
130
134
  return this.propertiesConfig.containerType === "Tearsheet";
131
135
  }
@@ -1153,15 +1157,16 @@ export default class PropertiesController {
1153
1157
  getPropertyValues(options) {
1154
1158
  const propertyValues = this.propertiesStore.getPropertyValues();
1155
1159
  let returnValues = propertyValues;
1156
- if (options && (options.filterHiddenDisabled || options.filterHidden || options.filterDisabled || options.filterHiddenControls)) {
1160
+ if (options && (options.filterHiddenDisabled || options.filterHidden || options.filterDisabled || options.filterHiddenControls || options.valueFilters)) {
1157
1161
  const filteredValues = {};
1158
1162
  for (const propKey in propertyValues) {
1159
1163
  if (!has(propertyValues, propKey)) {
1160
1164
  continue;
1161
1165
  }
1162
1166
  const filteredValue = this.getPropertyValue({ name: propKey }, options);
1163
- // only set parameters with values
1164
- if (typeof filteredValue !== "undefined") {
1167
+ // only set parameters with values or filter out values specified in config
1168
+ const valueFilters = Array.isArray(options.valueFilters) ? options.valueFilters : [];
1169
+ if (typeof filteredValue !== "undefined" && !valueFilters.includes(filteredValue)) {
1165
1170
  filteredValues[propKey] = filteredValue;
1166
1171
  }
1167
1172
  }
@@ -1185,7 +1190,7 @@ export default class PropertiesController {
1185
1190
  }
1186
1191
 
1187
1192
  setPropertyValues(values, isInitProps) {
1188
- const inValues = cloneDeep(values);
1193
+ let inValues = cloneDeep(values);
1189
1194
 
1190
1195
  // convert currentParameters of type:object to array values
1191
1196
  if (values) {
@@ -1198,6 +1203,10 @@ export default class PropertiesController {
1198
1203
  inValues[propertyName] = convertedValues;
1199
1204
  }
1200
1205
  });
1206
+
1207
+ if (get(this.getPropertiesConfig(), "convertValueDataTypes")) {
1208
+ inValues = PropertyUtils.convertValueDataTypes(inValues, controls);
1209
+ }
1201
1210
  }
1202
1211
 
1203
1212
  this.propertiesStore.setPropertyValues(inValues);
@@ -123,6 +123,10 @@ class PropertiesMain extends React.Component {
123
123
  }
124
124
  }
125
125
  }
126
+
127
+ if (newProps.propertiesConfig && !isEqual(newProps.propertiesConfig, this.propertiesController.getPropertiesConfig())) {
128
+ this.propertiesController.setPropertiesConfig(newProps.propertiesConfig);
129
+ }
126
130
  }
127
131
 
128
132
  onBlur(e) {
@@ -144,7 +148,7 @@ class PropertiesMain extends React.Component {
144
148
  if (this.props.propertiesConfig.schemaValidation) {
145
149
  validateParameterDefAgainstSchema(propertiesInfo.parameterDef);
146
150
  }
147
- formData = Form.makeForm(propertiesInfo.parameterDef, this.props.propertiesConfig.containerType, this.props.propertiesConfig.convertValueDataTypes);
151
+ formData = Form.makeForm(propertiesInfo.parameterDef, this.props.propertiesConfig.containerType);
148
152
  }
149
153
  // TODO: This can be removed once the WML Play service generates datasetMetadata instead of inputDataModel
150
154
  if (formData && formData.data && formData.data.inputDataModel && !formData.data.datasetMetadata) {
@@ -333,7 +337,9 @@ class PropertiesMain extends React.Component {
333
337
  _setValueInforProperties(valueInfo, options) {
334
338
  const applyProperties = options && options.applyProperties === true;
335
339
  const filterHiddenDisabled = this.props.propertiesConfig.conditionReturnValueHandling === CONDITION_RETURN_VALUE_HANDLING.NULL;
336
- const properties = this.propertiesController.getPropertyValues({ filterHiddenDisabled: filterHiddenDisabled, applyProperties: applyProperties });
340
+
341
+ const properties = this.propertiesController.getPropertyValues({ filterHiddenDisabled: filterHiddenDisabled, applyProperties: applyProperties,
342
+ valueFilters: this.props.propertiesConfig.returnValueFiltering });
337
343
  if (this.uiParameterKeys.length > 0) {
338
344
  valueInfo.properties = omit(properties, this.uiParameterKeys);
339
345
  valueInfo.uiProperties = pick(properties, this.uiParameterKeys);
@@ -603,6 +609,7 @@ PropertiesMain.propTypes = {
603
609
  containerType: PropTypes.string,
604
610
  enableResize: PropTypes.bool,
605
611
  conditionReturnValueHandling: PropTypes.string,
612
+ returnValueFiltering: PropTypes.array,
606
613
  heading: PropTypes.bool,
607
614
  buttonLabels: PropTypes.shape({
608
615
  primary: PropTypes.string,
@@ -615,7 +622,8 @@ PropertiesMain.propTypes = {
615
622
  maxLengthForMultiLineControls: PropTypes.number,
616
623
  maxLengthForSingleLineControls: PropTypes.number,
617
624
  convertValueDataTypes: PropTypes.bool,
618
- showRequiredIndicator: PropTypes.bool
625
+ showRequiredIndicator: PropTypes.bool,
626
+ locale: PropTypes.string
619
627
  }),
620
628
  callbacks: PropTypes.shape({
621
629
  controllerHandler: PropTypes.func,
@@ -22,7 +22,7 @@ function op() {
22
22
  }
23
23
 
24
24
  function evaluate(paramInfo, param2Info, value, controller) {
25
- const unsupportedControls = ["checkbox", "numberfield", "passwordfield"];
25
+ const unsupportedControls = ["checkbox", "numberfield", "passwordfield", "datepicker", "datepickerRange"];
26
26
  if (unsupportedControls.indexOf(paramInfo.control.controlType) < 0) {
27
27
  const dataType = typeof paramInfo.value;
28
28
  if (typeof param2Info !== "undefined") {
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017-2022 Elyra Authors
2
+ * Copyright 2017-2023 Elyra Authors
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import { ControlType } from "../../constants/form-constants";
17
18
  import logger from "./../../../../utils/logger";
18
19
 
19
20
  function op() {
@@ -41,6 +42,26 @@ function evaluate(paramInfo, param2Info, value, controller) {
41
42
  return true;
42
43
  }
43
44
  return false;
45
+ case "string": {
46
+ if (paramInfo.control.controlType === ControlType.DATEPICKER) {
47
+ const param1Date = new Date(paramInfo.value);
48
+ if (!isNaN(param1Date) && param2Info) {
49
+ const param2Date = new Date(param2Info.value);
50
+ if (!isNaN(param2Date)) {
51
+ return param1Date.getTime() > param2Date.getTime();
52
+ }
53
+ throw new Error("Insufficient parameter for condition operation 'greaterThan'");
54
+ } else if (!isNaN(param1Date) && value) {
55
+ const valueDate = new Date(value);
56
+ if (!isNaN(valueDate)) {
57
+ return param1Date.getTime() > valueDate.getTime();
58
+ }
59
+ throw new Error("Insufficient parameter for condition operation 'greaterThan'");
60
+ }
61
+ throw new Error("Insufficient parameter for condition operation 'greaterThan'");
62
+ }
63
+ return true;
64
+ }
44
65
  default:
45
66
  logger.warn("Ignoring condition operation 'greaterThan' for parameter_ref " + paramInfo.param + " with input data type " + dataType);
46
67
  return true;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017-2022 Elyra Authors
2
+ * Copyright 2017-2023 Elyra Authors
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { isValid, parse } from "date-fns";
18
18
  import { DEFAULT_DATE_FORMAT } from "../../constants/constants";
19
-
19
+ import { ControlType } from "../../constants/form-constants";
20
20
 
21
21
  function op() {
22
22
  return "isDateTime";
@@ -24,10 +24,13 @@ function op() {
24
24
 
25
25
  function evaluate(paramInfo, param2Info, value, controller) {
26
26
  if (paramInfo.value) { // only check if there is a value.
27
- // always use iso format for time
28
- const timeDateFormat = (value === "time") ? "HH:mm:ss:xxx" : DEFAULT_DATE_FORMAT;
29
- const date = parse(paramInfo.value, timeDateFormat, new Date());
30
- return isValid(date);
27
+ if (paramInfo.control.controlType !== ControlType.DATEPICKER && paramInfo.control.controlType !== ControlType.DATEPICKERRANGE) {
28
+ // always use iso format for time
29
+ const timeDateFormat = (value === "time") ? "HH:mm:ss:xxx" : DEFAULT_DATE_FORMAT;
30
+ const date = parse(paramInfo.value, timeDateFormat, new Date());
31
+ return isValid(date);
32
+ }
33
+ return true;
31
34
  }
32
35
  return true;
33
36
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017-2022 Elyra Authors
2
+ * Copyright 2017-2023 Elyra Authors
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import { ControlType } from "../../constants/form-constants";
17
18
  import logger from "./../../../../utils/logger";
18
19
 
19
20
  function op() {
@@ -33,6 +34,11 @@ function evaluate(paramInfo, param2Info, value, controller) {
33
34
  case "number":
34
35
  return paramInfo.value === null;
35
36
  case "object":
37
+ if (paramInfo.control.controlType === ControlType.DATEPICKERRANGE) {
38
+ const startDate = paramInfo.value[0].trim();
39
+ const endDate = paramInfo.value[1].trim();
40
+ return startDate === "" && endDate === ""; // DATEPICKERRANGE is empty if both start and end dates are empty
41
+ }
36
42
  return paramInfo.value === null ? true : paramInfo.value.length === 0;
37
43
  default:
38
44
  logger.warn("Ignoring condition operation 'isEmpty' for parameter_ref " + paramInfo.param + " with input data type " + dataType);
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017-2022 Elyra Authors
2
+ * Copyright 2017-2023 Elyra Authors
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import { ControlType } from "../../constants/form-constants";
17
18
  import logger from "./../../../../utils/logger";
18
19
 
19
20
  function op() {
@@ -32,6 +33,9 @@ function evaluate(paramInfo, param2Info, value, controller) {
32
33
  case "number":
33
34
  return paramInfo.value !== null;
34
35
  case "object":
36
+ if (paramInfo.control.controlType === ControlType.DATEPICKERRANGE) {
37
+ return paramInfo.value[0].trim() !== "" || paramInfo.value[1].trim() !== "";
38
+ }
35
39
  return paramInfo.value === null ? false : paramInfo.value.length !== 0;
36
40
  default:
37
41
  logger.warn("Ignoring condition operation 'isNotEmpty' for parameter_ref " + paramInfo.param + " with input data type " + dataType);
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017-2022 Elyra Authors
2
+ * Copyright 2017-2023 Elyra Authors
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import { ControlType } from "../../constants/form-constants";
17
18
  import logger from "./../../../../utils/logger";
18
19
 
19
20
  function op() {
@@ -42,6 +43,26 @@ function evaluate(paramInfo, param2Info, value, controller) {
42
43
  return true;
43
44
  }
44
45
  return false;
46
+ case "string": {
47
+ if (paramInfo.control.controlType === ControlType.DATEPICKER) {
48
+ const param1Date = new Date(paramInfo.value);
49
+ if (!isNaN(param1Date) && param2Info) {
50
+ const param2Date = new Date(param2Info.value);
51
+ if (!isNaN(param2Date)) {
52
+ return param1Date.getTime() < param2Date.getTime();
53
+ }
54
+ throw new Error("Insufficient parameter for condition operation 'lessThan'");
55
+ } else if (!isNaN(param1Date) && value) {
56
+ const valueDate = new Date(value);
57
+ if (!isNaN(valueDate)) {
58
+ return param1Date.getTime() < valueDate.getTime();
59
+ }
60
+ throw new Error("Insufficient parameter for condition operation 'lessThan'");
61
+ }
62
+ throw new Error("Insufficient parameter for condition operation 'lessThan'");
63
+ }
64
+ return true;
65
+ }
45
66
  default:
46
67
  logger.warn("Ignoring condition operation 'lessThan' for parameter_ref " + paramInfo.param + " with input data type " + dataType);
47
68
  return true;
@@ -22,7 +22,7 @@ function op() {
22
22
  }
23
23
 
24
24
  function evaluate(paramInfo, param2Info, value, controller) {
25
- const unsupportedControls = ["checkbox", "numberfield", "passwordfield"];
25
+ const unsupportedControls = ["checkbox", "numberfield", "passwordfield", "datepicker", "datepickerRange"];
26
26
  if (unsupportedControls.indexOf(paramInfo.control.controlType) < 0) {
27
27
  const dataType = typeof paramInfo.value;
28
28
  if (typeof param2Info !== "undefined") {
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017-2022 Elyra Authors
2
+ * Copyright 2017-2023 Elyra Authors
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -20,9 +20,11 @@ import * as UiConditions from "./ui-conditions";
20
20
  import { formatMessage } from "../util/property-utils";
21
21
  import { DEFAULT_VALIDATION_MESSAGE, STATES, PANEL_TREE_ROOT,
22
22
  CONDITION_TYPE, CONDITION_DEFINITION_INDEX,
23
- MESSAGE_KEYS, DEFAULT_DATE_FORMAT, DEFAULT_TIME_FORMAT } from "../constants/constants";
23
+ MESSAGE_KEYS
24
+ } from "../constants/constants";
24
25
  import { isEmpty, cloneDeep, has, union, isEqual } from "lodash";
25
26
  import seedrandom from "seedrandom";
27
+ import { getDateTimeFormat } from "../util/control-utils";
26
28
 
27
29
 
28
30
  // ========= APIs ==================
@@ -1089,9 +1091,7 @@ function _injectRequiredDefinition(control, valDefinitions, requiredDefinitionsI
1089
1091
 
1090
1092
  function _injectDateTimeDefinition(control, valDefinitions, keyName, controlValId, intl) {
1091
1093
  // inject date format validation definition
1092
- const format = (control.dateFormat) ? control.dateFormat : control.timeFormat;
1093
- const defaultFormat = (control.dateFormat) ? DEFAULT_DATE_FORMAT : DEFAULT_TIME_FORMAT;
1094
- const dtFormat = (format) ? format : defaultFormat;
1094
+ const dtFormat = getDateTimeFormat(control);
1095
1095
  const errorMsg = formatMessage(intl,
1096
1096
  MESSAGE_KEYS.DATETIME_FORMAT_ERROR, { role: control.role, format: dtFormat });
1097
1097
  const injectedDefinition = {
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017-2022 Elyra Authors
2
+ * Copyright 2017-2023 Elyra Authors
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { v4 as uuid4 } from "uuid";
17
- import { TRUNCATE_LIMIT } from "../constants/constants";
17
+ import { TRUNCATE_LIMIT, DEFAULT_DATEPICKER_FORMAT, DEFAULT_DATE_FORMAT, DEFAULT_TIME_FORMAT } from "../constants/constants";
18
+ import { ControlType } from "../constants/form-constants";
18
19
 
19
20
  /**
20
21
  * Used to return a unique id for a control that requires an html id
@@ -110,6 +111,19 @@ function getValidationProps(messageInfo, inTable) {
110
111
  return validationProps;
111
112
  }
112
113
 
114
+ // Get the format of the date/time control
115
+ function getDateTimeFormat(control) {
116
+ let dtFormat;
117
+ if (control.controlType === ControlType.DATEPICKER || control.controlType === ControlType.DATEPICKERRANGE) {
118
+ dtFormat = (control.dateFormat) ? control.dateFormat : DEFAULT_DATEPICKER_FORMAT;
119
+ } else if (control.controlType === ControlType.DATEFIELD) {
120
+ dtFormat = (control.dateFormat) ? control.dateFormat : DEFAULT_DATE_FORMAT;
121
+ } else { // time
122
+ dtFormat = (control.timeFormat) ? control.timeFormat : DEFAULT_TIME_FORMAT;
123
+ }
124
+ return dtFormat;
125
+ }
126
+
113
127
  export {
114
128
  getCharLimit,
115
129
  getControlId,
@@ -117,5 +131,6 @@ export {
117
131
  splitNewlines,
118
132
  joinNewlines,
119
133
  truncateDisplayValue,
120
- getValidationProps
134
+ getValidationProps,
135
+ getDateTimeFormat
121
136
  };