@elyra/canvas 12.23.1 → 12.24.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.
Files changed (195) hide show
  1. package/dist/canvas-constants-07dbe4b7.js +2 -0
  2. package/dist/{canvas-constants-ab55d0fd.js.map → canvas-constants-07dbe4b7.js.map} +1 -1
  3. package/dist/canvas-constants-ba465147.js +2 -0
  4. package/dist/canvas-constants-ba465147.js.map +1 -0
  5. package/dist/canvas-controller-60ed1f25.js +2 -0
  6. package/dist/canvas-controller-60ed1f25.js.map +1 -0
  7. package/dist/canvas-controller-6239cacc.js +2 -0
  8. package/dist/canvas-controller-6239cacc.js.map +1 -0
  9. package/dist/{canvas-logger-fa8cef5b.js → canvas-logger-27d3180d.js} +2 -2
  10. package/dist/{canvas-logger-fa8cef5b.js.map → canvas-logger-27d3180d.js.map} +1 -1
  11. package/dist/{canvas-logger-3459dfc2.js → canvas-logger-bb537fb3.js} +2 -2
  12. package/dist/{canvas-logger-3459dfc2.js.map → canvas-logger-bb537fb3.js.map} +1 -1
  13. package/dist/common-canvas-4ae99af6.js +2 -0
  14. package/dist/common-canvas-4ae99af6.js.map +1 -0
  15. package/dist/common-canvas-86633e44.js +2 -0
  16. package/dist/common-canvas-86633e44.js.map +1 -0
  17. package/dist/common-canvas.es.js +1 -1
  18. package/dist/common-canvas.js +1 -1
  19. package/dist/common-properties-2bc0b14a.js +2 -0
  20. package/dist/common-properties-2bc0b14a.js.map +1 -0
  21. package/dist/common-properties-56bf68a6.js +2 -0
  22. package/dist/common-properties-56bf68a6.js.map +1 -0
  23. package/dist/createClass-826941b3.js +2 -0
  24. package/dist/createClass-826941b3.js.map +1 -0
  25. package/dist/createClass-be661622.js +2 -0
  26. package/dist/createClass-be661622.js.map +1 -0
  27. package/dist/{datarecord-metadata-v3-schema-03db5d5d.js → datarecord-metadata-v3-schema-3323a91e.js} +2 -2
  28. package/dist/{datarecord-metadata-v3-schema-03db5d5d.js.map → datarecord-metadata-v3-schema-3323a91e.js.map} +1 -1
  29. package/dist/{datarecord-metadata-v3-schema-07d7682c.js → datarecord-metadata-v3-schema-93ec5562.js} +2 -2
  30. package/dist/{datarecord-metadata-v3-schema-07d7682c.js.map → datarecord-metadata-v3-schema-93ec5562.js.map} +1 -1
  31. package/dist/en-7201b548.js +2 -0
  32. package/dist/{en-8647c347.js.map → en-7201b548.js.map} +1 -1
  33. package/dist/en-a08356c8.js +2 -0
  34. package/dist/{en-7a0f1db1.js.map → en-a08356c8.js.map} +1 -1
  35. package/dist/extends-11efb86b.js +7 -0
  36. package/dist/extends-11efb86b.js.map +1 -0
  37. package/dist/extends-bb395e42.js +7 -0
  38. package/dist/extends-bb395e42.js.map +1 -0
  39. package/dist/flexible-table-989859ec.js +2 -0
  40. package/dist/flexible-table-989859ec.js.map +1 -0
  41. package/dist/flexible-table-d51a7d72.js +2 -0
  42. package/dist/flexible-table-d51a7d72.js.map +1 -0
  43. package/dist/getPrototypeOf-1e698126.js +2 -0
  44. package/dist/getPrototypeOf-1e698126.js.map +1 -0
  45. package/dist/getPrototypeOf-3751add9.js +2 -0
  46. package/dist/getPrototypeOf-3751add9.js.map +1 -0
  47. package/dist/icon-037ad6d1.js +2 -0
  48. package/dist/{icon-816af0e7.js.map → icon-037ad6d1.js.map} +1 -1
  49. package/dist/icon-b619470c.js +2 -0
  50. package/dist/{icon-2c16236a.js.map → icon-b619470c.js.map} +1 -1
  51. package/dist/{index-2f6be19d.js → index-46a80c08.js} +2 -2
  52. package/dist/{index-2f6be19d.js.map → index-46a80c08.js.map} +1 -1
  53. package/dist/index-b527a82d.js +2 -0
  54. package/dist/{index-6f739fa1.js.map → index-b527a82d.js.map} +1 -1
  55. package/dist/isArrayLikeObject-a9c7973b.js +1 -1
  56. package/dist/isArrayLikeObject-a9c7973b.js.map +1 -1
  57. package/dist/isArrayLikeObject-f3b27f64.js +1 -1
  58. package/dist/isArrayLikeObject-f3b27f64.js.map +1 -1
  59. package/dist/lib/canvas-controller.es.js +1 -1
  60. package/dist/lib/canvas-controller.js +1 -1
  61. package/dist/lib/canvas.es.js +1 -1
  62. package/dist/lib/canvas.js +1 -1
  63. package/dist/lib/command-stack.es.js +1 -1
  64. package/dist/lib/command-stack.js +1 -1
  65. package/dist/lib/context-menu.es.js +1 -1
  66. package/dist/lib/context-menu.js +1 -1
  67. package/dist/lib/properties/field-picker.es.js +1 -1
  68. package/dist/lib/properties/field-picker.js +1 -1
  69. package/dist/lib/properties/flexible-table.es.js +1 -1
  70. package/dist/lib/properties/flexible-table.js +1 -1
  71. package/dist/lib/properties.es.js +1 -1
  72. package/dist/lib/properties.js +1 -1
  73. package/dist/lib/tooltip.es.js +1 -1
  74. package/dist/lib/tooltip.js +1 -1
  75. package/dist/styles/common-canvas.min.css +1 -1
  76. package/dist/styles/common-canvas.min.css.map +1 -1
  77. package/dist/toolbar-3f93ec4b.js +2 -0
  78. package/dist/toolbar-3f93ec4b.js.map +1 -0
  79. package/dist/toolbar-e4c551ae.js +2 -0
  80. package/dist/toolbar-e4c551ae.js.map +1 -0
  81. package/locales/command-actions/locales/en.json +1 -1
  82. package/locales/command-actions/locales/eo.json +41 -41
  83. package/locales/common-canvas/locales/en.json +1 -0
  84. package/locales/common-canvas/locales/eo.json +1 -0
  85. package/locales/common-properties/locales/de.json +10 -1
  86. package/locales/common-properties/locales/en.json +4 -1
  87. package/locales/common-properties/locales/eo.json +23 -18
  88. package/locales/common-properties/locales/es.json +10 -1
  89. package/locales/common-properties/locales/fr.json +10 -1
  90. package/locales/common-properties/locales/it.json +10 -1
  91. package/locales/common-properties/locales/ja.json +10 -1
  92. package/locales/common-properties/locales/ko.json +10 -1
  93. package/locales/common-properties/locales/pt-br.json +10 -1
  94. package/locales/common-properties/locales/sv.json +10 -1
  95. package/locales/common-properties/locales/zh-CN.json +10 -1
  96. package/locales/common-properties/locales/zh-TW.json +10 -1
  97. package/package.json +1 -1
  98. package/src/common-canvas/canvas-controller.js +38 -4
  99. package/src/common-canvas/svg-canvas-d3.js +12 -0
  100. package/src/common-canvas/svg-canvas-renderer.js +244 -66
  101. package/src/common-canvas/svg-canvas-utils-links.js +37 -7
  102. package/src/common-canvas/svg-canvas-utils-markdown.js +0 -2
  103. package/src/common-canvas/svg-canvas-utils-textarea.js +56 -43
  104. package/src/common-properties/components/editor-form/editor-form.jsx +19 -5
  105. package/src/common-properties/components/editor-form/editor-form.scss +30 -3
  106. package/src/common-properties/components/field-picker/field-picker.jsx +18 -59
  107. package/src/common-properties/components/field-picker/field-picker.scss +15 -24
  108. package/src/common-properties/components/flexible-table/flexible-table.jsx +32 -16
  109. package/src/common-properties/components/flexible-table/flexible-table.scss +6 -12
  110. package/src/common-properties/components/properties-modal/properties-modal.jsx +3 -1
  111. package/src/common-properties/components/properties-modal/properties-modal.scss +1 -0
  112. package/src/common-properties/components/table-buttons/table-buttons.jsx +1 -0
  113. package/src/common-properties/components/table-buttons/table-buttons.scss +4 -26
  114. package/src/common-properties/components/virtualized-table/virtualized-table.jsx +6 -5
  115. package/src/common-properties/constants/constants.js +11 -2
  116. package/src/common-properties/controls/abstract-table.jsx +12 -4
  117. package/src/common-properties/controls/datefield/datefield.jsx +1 -1
  118. package/src/common-properties/controls/dropdown/dropdown.jsx +3 -3
  119. package/src/common-properties/controls/expression/expression-builder/expression-select-field-function.jsx +11 -2
  120. package/src/common-properties/controls/expression/expression-toggle/expression-toggle.jsx +5 -6
  121. package/src/common-properties/controls/expression/expression.jsx +3 -1
  122. package/src/common-properties/controls/expression/expression.scss +1 -2
  123. package/src/common-properties/controls/list/list.jsx +1 -1
  124. package/src/common-properties/controls/multiselect/multiselect.jsx +2 -2
  125. package/src/common-properties/controls/numberfield/numberfield.jsx +30 -6
  126. package/src/common-properties/controls/passwordfield/passwordfield.jsx +13 -2
  127. package/src/common-properties/controls/radioset/radioset.scss +1 -5
  128. package/src/common-properties/controls/selectcolumns/selectcolumns.jsx +1 -1
  129. package/src/common-properties/controls/someofselect/someofselect.jsx +1 -1
  130. package/src/common-properties/controls/textarea/textarea.jsx +2 -2
  131. package/src/common-properties/controls/textfield/textfield.jsx +1 -1
  132. package/src/common-properties/controls/timefield/timefield.jsx +1 -1
  133. package/src/common-properties/form/ControlInfo.js +3 -1
  134. package/src/common-properties/form/EditorForm.js +11 -11
  135. package/src/common-properties/index.scss +2 -4
  136. package/src/common-properties/panels/control/control.jsx +1 -0
  137. package/src/common-properties/panels/control/control.scss +12 -0
  138. package/src/common-properties/panels/sub-panel/invoker.jsx +2 -0
  139. package/src/common-properties/panels/sub-panel/sub-panel.scss +6 -0
  140. package/src/common-properties/panels/subtabs/subtabs.jsx +13 -3
  141. package/src/common-properties/panels/subtabs/subtabs.scss +62 -0
  142. package/src/common-properties/panels/tearsheet/tearsheet.jsx +64 -7
  143. package/src/common-properties/panels/tearsheet/tearsheet.scss +84 -18
  144. package/src/common-properties/properties-controller.js +4 -0
  145. package/src/common-properties/properties-main/properties-main.jsx +17 -1
  146. package/src/object-model/api-pipeline.js +1 -6
  147. package/src/object-model/canvas-in-handler.js +6 -3
  148. package/src/object-model/layout-dimensions.js +12 -0
  149. package/src/object-model/object-model.js +7 -39
  150. package/src/object-model/redux/canvas-store.js +55 -0
  151. package/src/toolbar/toolbar-action-item.jsx +3 -1
  152. package/src/toolbar/toolbar-overflow-item.jsx +3 -1
  153. package/src/toolbar/toolbar.jsx +6 -2
  154. package/src/toolbar/toolbar.scss +21 -0
  155. package/stats.html +1 -1
  156. package/dist/canvas-constants-09ffa4d4.js +0 -2
  157. package/dist/canvas-constants-09ffa4d4.js.map +0 -1
  158. package/dist/canvas-constants-ab55d0fd.js +0 -2
  159. package/dist/canvas-controller-3a399ae6.js +0 -2
  160. package/dist/canvas-controller-3a399ae6.js.map +0 -1
  161. package/dist/canvas-controller-c046093c.js +0 -2
  162. package/dist/canvas-controller-c046093c.js.map +0 -1
  163. package/dist/common-canvas-088c1a4b.js +0 -2
  164. package/dist/common-canvas-088c1a4b.js.map +0 -1
  165. package/dist/common-canvas-7676cc1b.js +0 -2
  166. package/dist/common-canvas-7676cc1b.js.map +0 -1
  167. package/dist/common-properties-9d77f8e1.js +0 -2
  168. package/dist/common-properties-9d77f8e1.js.map +0 -1
  169. package/dist/common-properties-a31de521.js +0 -2
  170. package/dist/common-properties-a31de521.js.map +0 -1
  171. package/dist/createClass-72b049bc.js +0 -2
  172. package/dist/createClass-72b049bc.js.map +0 -1
  173. package/dist/createClass-d5cac0b7.js +0 -2
  174. package/dist/createClass-d5cac0b7.js.map +0 -1
  175. package/dist/en-7a0f1db1.js +0 -2
  176. package/dist/en-8647c347.js +0 -2
  177. package/dist/extends-87da7df3.js +0 -7
  178. package/dist/extends-87da7df3.js.map +0 -1
  179. package/dist/extends-dc95dba8.js +0 -7
  180. package/dist/extends-dc95dba8.js.map +0 -1
  181. package/dist/flexible-table-59ad2c83.js +0 -2
  182. package/dist/flexible-table-59ad2c83.js.map +0 -1
  183. package/dist/flexible-table-5c4fbb7b.js +0 -2
  184. package/dist/flexible-table-5c4fbb7b.js.map +0 -1
  185. package/dist/getPrototypeOf-4e282dd3.js +0 -2
  186. package/dist/getPrototypeOf-4e282dd3.js.map +0 -1
  187. package/dist/getPrototypeOf-b3806813.js +0 -2
  188. package/dist/getPrototypeOf-b3806813.js.map +0 -1
  189. package/dist/icon-2c16236a.js +0 -2
  190. package/dist/icon-816af0e7.js +0 -2
  191. package/dist/index-6f739fa1.js +0 -2
  192. package/dist/toolbar-2ef99bd8.js +0 -2
  193. package/dist/toolbar-2ef99bd8.js.map +0 -1
  194. package/dist/toolbar-cb967e26.js +0 -2
  195. package/dist/toolbar-cb967e26.js.map +0 -1
@@ -22,7 +22,7 @@ import ReactDOM from "react-dom";
22
22
  import PropTypes from "prop-types";
23
23
  import { Search } from "carbon-components-react";
24
24
  import VirtualizedTable from "./../virtualized-table/virtualized-table.jsx";
25
- import { SORT_DIRECTION, STATES, ROW_HEIGHT, ROW_SELECTION } from "./../../constants/constants";
25
+ import { REM_ROW_HEIGHT, REM_HEADER_HEIGHT, ONE_REM_HEIGHT, SORT_DIRECTION, STATES, ROW_HEIGHT, ROW_SELECTION } from "./../../constants/constants";
26
26
  import ReactResizeDetector from "react-resize-detector";
27
27
  import classNames from "classnames";
28
28
  import { has, isEmpty } from "lodash";
@@ -45,7 +45,9 @@ class FlexibleTable extends React.Component {
45
45
  columnSortDir: sortDirs,
46
46
  currentSortColumn: "",
47
47
  tableWidth: 0,
48
- tableHeight: 0
48
+ tableHeight: 0,
49
+ rows: typeof props.rows !== "undefined" ? props.rows : 5.5,
50
+ dynamicHeight: null
49
51
  };
50
52
 
51
53
  this.rowHeight = this.rowHeight.bind(this);
@@ -243,29 +245,30 @@ class FlexibleTable extends React.Component {
243
245
  return;
244
246
  }
245
247
  let newHeight = this.state.tableHeight;
246
- const rowHeight = 2; // in rem
247
- const headerHeight = 2; // in rem
248
- const rows = typeof this.props.rows !== "undefined" ? this.props.rows : 5.5;
249
- if (Array.isArray(this.props.data) && this.props.data.length < rows) {
250
- newHeight = (rowHeight * this.props.data.length + headerHeight) + "rem";
251
- } else if (rows > 0) {
252
- newHeight = (rowHeight * rows + headerHeight) + "rem";
253
- } else if (rows === 0) { // only display header
254
- newHeight = headerHeight + "rem";
255
- } else if (rows === -1) {
248
+ let dynamicH = this.state.dynamicHeight;
249
+ const multiSelectTableHeight = REM_ROW_HEIGHT + REM_HEADER_HEIGHT;
250
+ if (Array.isArray(this.props.data) && this.props.data.length < this.state.rows) {
251
+ newHeight = (REM_ROW_HEIGHT * this.props.data.length + REM_HEADER_HEIGHT + (this.props.selectedEditRow ? multiSelectTableHeight : 0)) + "rem";
252
+ } else if (this.state.rows > 0) {
253
+ newHeight = (REM_ROW_HEIGHT * this.state.rows + REM_HEADER_HEIGHT + (this.props.selectedEditRow ? multiSelectTableHeight : 0)) + "rem";
254
+ } else if (this.state.rows === 0) { // only display header
255
+ newHeight = REM_HEADER_HEIGHT + "rem";
256
+ } else if (this.state.rows === -1) {
256
257
  if (this.flexibleTable) {
257
258
  const labelAndDescriptionHeight = 50; // possible dynamically set this in the future
258
259
  const ftHeaderHeight = (typeof this.flexibleTableHeader !== "undefined") ? ReactDOM.findDOMNode(this.flexibleTableHeader).getBoundingClientRect().height : 0;
259
260
  const flyoutHeight = this.findPropertyNodeHeight(this.flexibleTable, "properties-wf-children");
260
261
  if (flyoutHeight === 0) {
261
262
  newHeight = "100vh"; // set full window height if flyout height not found
263
+ dynamicH = -1;
262
264
  } else {
263
265
  newHeight = `calc(${flyoutHeight - ftHeaderHeight - labelAndDescriptionHeight}px - 3.5rem)`; // 3.5rem to adjust padding
266
+ dynamicH = (flyoutHeight - ftHeaderHeight - labelAndDescriptionHeight) - (3.5 * 16);
264
267
  }
265
268
  }
266
269
  }
267
270
  if (newHeight !== this.state.tableHeight) {
268
- this.setState({ tableHeight: newHeight });
271
+ this.setState({ tableHeight: newHeight, dynamicHeight: dynamicH });
269
272
  }
270
273
  }
271
274
 
@@ -498,7 +501,7 @@ class FlexibleTable extends React.Component {
498
501
  }
499
502
 
500
503
  const containerClass = this.props.showHeader ? "properties-ft-container-absolute " : "properties-ft-container-absolute-noheader ";
501
- const messageClass = (!this.props.messageInfo) ? containerClass + STATES.INFO : containerClass + this.props.messageInfo.type;
504
+ const messageClass = (!this.props.messageInfo) ? containerClass + STATES.INFO : containerClass;
502
505
  const ftHeader = (searchBar || this.props.topRightPanel)
503
506
  ? (<div className="properties-ft-table-header" ref={ (ref) => (this.flexibleTableHeader = ref) }>
504
507
  {searchBar}
@@ -514,16 +517,29 @@ class FlexibleTable extends React.Component {
514
517
  )
515
518
  : null;
516
519
 
520
+ const ftClassname = classNames("properties-ft-control-container", { "properties-light-disabled": !this.props.light });
521
+
522
+ let tableHeight = 0;
523
+ const multiSelectEditRowsRem = 2 * REM_HEADER_HEIGHT; // multi-select adds two rows when selectedEditRow
524
+ const multiSelectEditRowsPixels = multiSelectEditRowsRem * ONE_REM_HEIGHT;
525
+ if (this.state.rows !== -1 && this.state.tableHeight) {
526
+ const remHeight = parseInt(this.state.tableHeight, 10);
527
+ tableHeight = (remHeight - (this.props.selectedEditRow ? multiSelectEditRowsRem : 0)) * ONE_REM_HEIGHT;
528
+ } else if (this.state.rows === -1 && this.state.dynamicHeight && this.state.dynamicHeight !== -1) {
529
+ tableHeight = this.state.dynamicHeight - (this.props.selectedEditRow ? multiSelectEditRowsPixels : 0);
530
+ }
531
+
517
532
  return (
518
- <div data-id={"properties-ft-" + this.props.scrollKey} className="properties-ft-control-container" ref={ (ref) => (this.flexibleTable = ref) }>
533
+ <div data-id={"properties-ft-" + this.props.scrollKey} className={ftClassname} ref={ (ref) => (this.flexibleTable = ref) }>
519
534
  {ftHeader}
520
535
  <div className="properties-ft-container-panel">
521
536
  <ReactResizeDetector handleWidth onResize={this._updateTableWidth}>
522
- <div className="properties-ft-container-wrapper" style={ heightStyle }>
537
+ <div className={classNames("properties-ft-container-wrapper", this.props.messageInfo ? this.props.messageInfo.type : "")} style={ heightStyle }>
523
538
  <div className={messageClass}>
524
539
  {this.props.selectedEditRow}
525
540
  <VirtualizedTable
526
541
  tableLabel={this.props.tableLabel}
542
+ tableHeight={tableHeight}
527
543
  columns={headers}
528
544
  onHeaderClick={this.sortHeaderClick}
529
545
  rowCount={this.props.data.length}
@@ -52,6 +52,12 @@ $row-left-padding: $spacing-02;
52
52
  width: 100%;
53
53
  position: relative;
54
54
  overflow: hidden;
55
+ &.error {
56
+ border: 1px solid $support-01;
57
+ }
58
+ &.warning {
59
+ border: 1px solid $support-03;
60
+ }
55
61
  }
56
62
 
57
63
  // selectcolumns and tables without headers
@@ -64,24 +70,12 @@ $row-left-padding: $spacing-02;
64
70
  background-color: $ui-01;
65
71
  display: flex; // address scrollbar with mouse issue
66
72
  flex-direction: column; // address scrollbar with mouse issue
67
- &.error {
68
- border: 1px solid $support-01;
69
- }
70
- &.warning {
71
- border: 1px solid $support-03;
72
- }
73
73
  }
74
74
 
75
75
  .properties-ft-container-absolute {
76
76
  height: 100%;
77
77
  width: 100%;
78
78
  background-color: $ui-01;
79
- &.error {
80
- border: 1px solid $support-01;
81
- }
82
- &.warning {
83
- border: 1px solid $support-03;
84
- }
85
79
  .properties-ft-container {
86
80
  height: 100%;
87
81
  }
@@ -40,7 +40,7 @@ export default class PropertiesModal extends Component {
40
40
  return (
41
41
  <Portal>
42
42
  <Modal
43
- className={classNames("properties-modal", { "noButtons": this.props.showPropertiesButtons === false })}
43
+ className={classNames("properties-modal", { "noButtons": this.props.showPropertiesButtons === false }, this.props.classNames)}
44
44
  open
45
45
  modalHeading={this.props.title}
46
46
  primaryButtonText={this.props.applyLabel}
@@ -68,4 +68,6 @@ PropertiesModal.propTypes = {
68
68
  showPropertiesButtons: PropTypes.bool,
69
69
  applyLabel: PropTypes.string,
70
70
  rejectLabel: PropTypes.string,
71
+ classNames: PropTypes.string
71
72
  };
73
+
@@ -29,6 +29,7 @@
29
29
  .bx--modal-footer {
30
30
  opacity: 0;
31
31
  pointer-events: none;
32
+ display: none;
32
33
  }
33
34
  }
34
35
  }
@@ -111,6 +111,7 @@ class TableButtons extends React.Component {
111
111
  <Toolbar
112
112
  config={toolbarConfig}
113
113
  instanceId={0}
114
+ size="sm"
114
115
  toolbarActionHandler={this.customButtonOnClick}
115
116
  />
116
117
  </div>);
@@ -16,34 +16,12 @@
16
16
 
17
17
  .properties-custom-table-buttons {
18
18
  .toolbar-div {
19
- height: $spacing-07;
20
-
21
- .toolbar-left-bar {
22
- padding-right: 0;
23
-
24
- .toolbar-item button {
25
- height: $spacing-07;
26
- }
27
-
28
- .toolbar-item-content {
29
- padding: $spacing-02 $spacing-03;
30
- height: $spacing-07;
31
- min-width: $spacing-07;
32
- align-items: center;
33
- }
34
-
35
- .toolbar-overflow-item button {
36
- height: $spacing-07;
37
- }
38
-
39
- .toolbar-popover-list {
40
- top: $spacing-07;
41
- right: 0;
42
- }
43
- }
44
-
45
19
  .toolbar-right-bar {
46
20
  display: none;
47
21
  }
48
22
  }
23
+ .toolbar-popover-list {
24
+ top: $spacing-07;
25
+ right: 0;
26
+ }
49
27
  }
@@ -461,10 +461,6 @@ class VirtualizedTable extends React.Component {
461
461
  render() {
462
462
  const defaultTestHeight = 2000; // 2000 is set to accommodate test data "category-selection-data" with all categories expanded
463
463
 
464
- // AutoSizer manages width and height properties so the table fills the available space.
465
- // It does a direct DOM manipulation to the parent, outside React's VirtualDOM.
466
- // Since the actual DOM is not available when unit testing, we are passing in a default
467
- // width of 500 and a default height of 300.
468
464
  return (
469
465
  <div className="properties-vt">
470
466
  <div className={classNames("properties-vt-autosizer",
@@ -476,7 +472,11 @@ class VirtualizedTable extends React.Component {
476
472
  <Table
477
473
  ref={this.virtualizedTableRef}
478
474
  width={width ? width : 500}
479
- height={height ? height : defaultTestHeight}
475
+ // AutoSizer manages width and height properties so the table fills the available space.
476
+ // It does a direct DOM manipulation to the parent, outside React's VirtualDOM.
477
+ // Since the actual DOM is not available when unit testing, we are passing in a default
478
+ // width of 500 and a default height of 300.
479
+ height={this.props.tableHeight || height || defaultTestHeight}
480
480
 
481
481
  className="properties-autosized-vt"
482
482
  aria-label={this.props.tableLabel ? this.props.tableLabel : ""}
@@ -530,6 +530,7 @@ VirtualizedTable.defaultProps = {
530
530
 
531
531
  VirtualizedTable.propTypes = {
532
532
  tableLabel: PropTypes.string,
533
+ tableHeight: PropTypes.number.isRequired,
533
534
  selectable: PropTypes.bool,
534
535
  summaryTable: PropTypes.bool,
535
536
  rowSelection: PropTypes.string,
@@ -21,7 +21,7 @@ export const MESSAGE_KEYS = {
21
21
  STRUCTURETABLE_ADDBUTTON_LABEL: "structureTable.addButton.label",
22
22
  STRUCTURETABLE_REMOVEBUTTON_LABEL: "structureTable.removeButton.label",
23
23
  FIELDPICKER_SAVEBUTTON_LABEL: "fieldPicker.saveButton.label",
24
- FIELDPICKER_SAVEBUTTON_TOOLTIP: "fieldPicker.saveButton.tooltip",
24
+ FIELDPICKER_SAVEBUTTON_MODAL_LABEL: "fieldPicker.saveButton.modal.label",
25
25
  FIELDPICKER_RESETBUTTON_LABEL: "fieldPicker.resetButton.label",
26
26
  FIELDPICKER_FILTER_LABEL: "fieldPicker.filter.label",
27
27
  FIELDPICKER_FIELDCOLUMN_LABEL: "fieldPicker.fieldColumn.label",
@@ -58,6 +58,7 @@ export const MESSAGE_KEYS = {
58
58
  REQUIRED_ERROR: "required.error",
59
59
  DATETIME_FORMAT_ERROR: "datetime.format.error",
60
60
  INVALID_FIELD_ERROR: "invalid.field.error",
61
+ INVALID_NUMBER_ERROR: "invalid.number.error",
61
62
  EXPRESSION_VALIDATE_LABEL: "expression.validate.label",
62
63
  EXPRESSION_VALIDATING_LABEL: "expression.validating.label",
63
64
  EXPRESSION_BUILDER_TITLE: "expression.builder.title",
@@ -86,6 +87,8 @@ export const MESSAGE_KEYS = {
86
87
  EXPRESSION_ALL_FUNCTIONS: "expression.all.functions",
87
88
  EXPRESSION_MIN_LABEL: "expression.min.label",
88
89
  EXPRESSION_MAX_LABEL: "expression.max.label",
90
+ EXPRESSION_MAXIMIZE_LABEL: "expression.maximize.label",
91
+ EXPRESSION_MINIMIZE_LABEL: "expression.minimize.label",
89
92
  EXPRESSION_NO_FUNCTIONS: "expression.no.functions",
90
93
  MULTI_SELECTED_ROW_LABEL: "multi.selected.row.label",
91
94
  MULTI_SELECTED_ROW_ACTION: "multi.selected.row.action",
@@ -107,7 +110,9 @@ export const MESSAGE_KEYS = {
107
110
  MULTISELECT_DROPDOWN_OPTIONS_SELECTED_LABEL: "multiselect.dropdown.options.selected.label",
108
111
  PROPERTIES_EMPTY_TABLE_TEXT: "properties.empty.table.text",
109
112
  TOGGLE_ON_LABEL: "toggle.on.label",
110
- TOGGLE_OFF_LABEL: "toggle.off.label"
113
+ TOGGLE_OFF_LABEL: "toggle.off.label",
114
+ SHOW_PASSWORD_TOOLTIP: "passwordShow.tooltip",
115
+ HIDE_PASSWORD_TOOLTIP: "passwordHide.tooltip"
111
116
  };
112
117
 
113
118
  export const TRUNCATE_LIMIT = 10000;
@@ -188,6 +193,10 @@ export const DEFAULT_LABEL_EDITABLE = true;
188
193
 
189
194
  export const ROW_HEIGHT = 32;
190
195
 
196
+ export const ONE_REM_HEIGHT = 16;
197
+ export const REM_ROW_HEIGHT = 2; // in rem
198
+ export const REM_HEADER_HEIGHT = 2; // in rem
199
+
191
200
  export const EXPRESSION_TABLE_ROWS = 7;
192
201
 
193
202
  export const TABLE_SUBPANEL_BUTTON_WIDTH = "36px";
@@ -71,7 +71,7 @@ export default class AbstractTable extends React.Component {
71
71
  this.buildChildItem = this.buildChildItem.bind(this);
72
72
  this.makeCells = this.makeCells.bind(this);
73
73
  this.checkedAll = this.checkedAll.bind(this);
74
-
74
+ this.isLightTheme = this.isLightTheme.bind(this);
75
75
 
76
76
  if (props.selectedRows && props.selectedRows.length > 0) {
77
77
  this.scrollToRow = props.selectedRows[props.selectedRows.length - 1];
@@ -258,16 +258,20 @@ export default class AbstractTable extends React.Component {
258
258
  const summaryPropertyId = {
259
259
  name: this.selectSummaryPropertyName
260
260
  };
261
+ const tableControl = this.props.controller.getControl({ name: this.props.control.name });
261
262
  const newSelectedSummaryRow = this.props.controller.getPropertyValue(summaryPropertyId);
262
263
  if (newSelectedSummaryRow && Array.isArray(newSelectedSummaryRow)) {
263
264
  newSelectedSummaryRow[0].forEach((cellValue, colIndex) => {
264
- if (!isEqual(cellValue, this.selectedSummaryRowValue[0][colIndex])) {
265
+ if (cellValue !== null && !isEqual(cellValue, this.selectedSummaryRowValue[0][colIndex])) {
265
266
  // if a column does not have a value, the default value is null and the value returned
266
267
  // from getPropertyValue is undefined causing unneccessary updates and an infinite loop during intialization
267
268
  const testCell = (typeof cellValue === "undefined") ? null : cellValue;
268
269
  this.props.selectedRows.forEach((rowIndex) => {
269
270
  this.props.controller.updatePropertyValue({ name: this.props.control.name, row: rowIndex, col: colIndex }, testCell, true);
270
271
  });
272
+ if (tableControl.subControls[colIndex].controlType === ControlType.ONEOFSELECT) {
273
+ this.props.controller.updatePropertyValue({ name: this.selectSummaryPropertyName, row: 0, col: colIndex }, null);
274
+ }
271
275
  }
272
276
  });
273
277
  this.selectedSummaryRowValue = cloneDeep(newSelectedSummaryRow);
@@ -429,6 +433,10 @@ export default class AbstractTable extends React.Component {
429
433
  }
430
434
  }
431
435
 
436
+ isLightTheme() {
437
+ return this.props.controller.getLight() && this.props.control.light && !this.props.controller.isTearsheetContainer();
438
+ }
439
+
432
440
  makeSelectedEditRow(selectedRows) {
433
441
  if (selectedRows && Array.isArray(selectedRows) && selectedRows.length > 1) {
434
442
  const rowsSelectedLabel = PropertyUtils.formatMessage(this.props.controller.getReactIntl(),
@@ -457,7 +465,7 @@ export default class AbstractTable extends React.Component {
457
465
  tableLabel={tableLabel}
458
466
  summaryTable
459
467
  rowSelection={ROW_SELECTION.MULTIPLE}
460
- light={this.props.controller.getLight()}
468
+ light={this.isLightTheme()}
461
469
  emptyTablePlaceholder={this.props.control.additionalText}
462
470
  />
463
471
  </div>);
@@ -677,7 +685,7 @@ export default class AbstractTable extends React.Component {
677
685
  updateRowSelections={rowClickCallback}
678
686
  selectedRows= {this.props.selectedRows}
679
687
  rowSelection={this.props.control.rowSelection}
680
- light={this.props.controller.getLight()}
688
+ light={this.isLightTheme()}
681
689
  emptyTablePlaceholder={this.props.control.additionalText}
682
690
  />);
683
691
  return (
@@ -83,7 +83,7 @@ class DatefieldControl extends React.Component {
83
83
  value={this.value}
84
84
  labelText={this.props.controlItem}
85
85
  hideLabel={this.props.tableControl}
86
- light={this.props.controller.getLight() && !this.props.control.light}
86
+ light={this.props.controller.getLight() && this.props.control.light}
87
87
  />
88
88
  <ValidationMessage inTable={this.props.tableControl} tableOnly state={this.props.state} messageInfo={this.props.messageInfo} />
89
89
  </div>
@@ -208,7 +208,7 @@ class DropDown extends React.Component {
208
208
  disabled={this.props.state === STATES.DISABLED}
209
209
  onChange={this.handleChange}
210
210
  value={selection}
211
- light={this.props.controller.getLight() && !this.props.control.light}
211
+ light={this.props.controller.getLight() && this.props.control.light}
212
212
  >
213
213
  { options }
214
214
  </Select>);
@@ -223,7 +223,7 @@ class DropDown extends React.Component {
223
223
  items={dropDown.options}
224
224
  onChange={this.handleComboOnChange}
225
225
  onInputChange={this.handleOnInputChange}
226
- light={this.props.controller.getLight() && !this.props.control.light}
226
+ light={this.props.controller.getLight() && this.props.control.light}
227
227
  translateWithId={(id) => listBoxMenuIconTranslationIds[id]}
228
228
  titleText={this.props.controlItem}
229
229
  />);
@@ -237,7 +237,7 @@ class DropDown extends React.Component {
237
237
  onChange={this.handleChange}
238
238
  selectedItem={dropDown.selectedOption}
239
239
  label={this.emptyLabel}
240
- light={this.props.controller.getLight() && !this.props.control.light}
240
+ light={this.props.controller.getLight() && this.props.control.light}
241
241
  translateWithId={(id) => listBoxMenuIconTranslationIds[id]}
242
242
  titleText={this.props.controlItem}
243
243
  />);
@@ -24,8 +24,9 @@ import { formatMessage } from "./../../../util/property-utils";
24
24
  import { sortBy, get } from "lodash";
25
25
  import { v4 as uuid4 } from "uuid";
26
26
 
27
- export default class ExpressionSelectFieldOrFunction extends React.Component {
27
+ const FIELDS_SPECIAL_CHARACTERS_REGEX = new RegExp("[0-9- _$]", "g");
28
28
 
29
+ export default class ExpressionSelectFieldOrFunction extends React.Component {
29
30
  constructor(props) {
30
31
  super(props);
31
32
  this.reactIntl = props.controller.getReactIntl();
@@ -76,6 +77,7 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
76
77
  this.onValueTableDblClick = this.onValueTableDblClick.bind(this);
77
78
 
78
79
  this.sortTableRows = this.sortTableRows.bind(this);
80
+ this.shouldQuoteField = this.shouldQuoteField.bind(this);
79
81
  }
80
82
 
81
83
  onSwitch(switchName, evt) {
@@ -125,7 +127,9 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
125
127
  }
126
128
  if (this.props.onChange) {
127
129
  const quote = (this.language === "CLEM" && this.state.fieldCategory !== "globals") ? "'" : "";
128
- value = quote + field.id + quote;
130
+ if (this.shouldQuoteField(field.id)) {
131
+ value = quote + field.id + quote;
132
+ }
129
133
  this.props.onChange(value);
130
134
  }
131
135
  }
@@ -229,6 +233,11 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
229
233
  return data;
230
234
  }
231
235
 
236
+ // Determine if field should be quoted - quote if the field name contains special characters
237
+ shouldQuoteField(field) {
238
+ return field.match(FIELDS_SPECIAL_CHARACTERS_REGEX) !== null;
239
+ }
240
+
232
241
  createContentObject(label) {
233
242
  let disabled = true;
234
243
  if (label) {
@@ -20,14 +20,14 @@ import PropTypes from "prop-types";
20
20
  import { injectIntl } from "react-intl";
21
21
  import { Button } from "carbon-components-react";
22
22
  import { Maximize16, Minimize16 } from "@carbon/icons-react";
23
-
24
- const maximizeId = "expression.maximize.label";
25
- const minimizeId = "expression.minimize.label";
23
+ import { formatMessage } from "../../../util/property-utils";
24
+ import { MESSAGE_KEYS } from "../../../constants/constants";
26
25
 
27
26
  class ExpressionToggle extends React.Component {
28
27
  constructor(props) {
29
28
  super(props);
30
29
  this.buttonHandler = props.controller.getHandlers().buttonHandler || (() => null);
30
+ this.reactIntl = props.controller.getReactIntl();
31
31
  }
32
32
  render() {
33
33
  return (
@@ -40,7 +40,7 @@ class ExpressionToggle extends React.Component {
40
40
  kind="ghost"
41
41
  renderIcon={Maximize16}
42
42
  hasIconOnly
43
- iconDescription={this.props.intl.formatMessage({ id: maximizeId })}
43
+ iconDescription={formatMessage(this.reactIntl, MESSAGE_KEYS.EXPRESSION_MAXIMIZE_LABEL)}
44
44
  onClick={() => {
45
45
  const handlerStatus = this.buttonHandler({
46
46
  type: "maximize_tearsheet",
@@ -57,7 +57,7 @@ class ExpressionToggle extends React.Component {
57
57
  kind="ghost"
58
58
  hasIconOnly
59
59
  renderIcon={Minimize16}
60
- iconDescription={this.props.intl.formatMessage({ id: minimizeId })}
60
+ iconDescription={formatMessage(this.reactIntl, MESSAGE_KEYS.EXPRESSION_MINIMIZE_LABEL)}
61
61
  onClick={() => this.props.controller.clearActiveTearsheet()}
62
62
  />)
63
63
  }
@@ -66,7 +66,6 @@ class ExpressionToggle extends React.Component {
66
66
  }
67
67
  }
68
68
  ExpressionToggle.propTypes = {
69
- intl: PropTypes.object.isRequired,
70
69
  control: PropTypes.object.isRequired,
71
70
  controller: PropTypes.object.isRequired,
72
71
  enableMaximize: PropTypes.bool
@@ -265,6 +265,7 @@ class ExpressionControl extends React.Component {
265
265
  _showBuilderButton() {
266
266
  // only show the button if there are function lists available and
267
267
  // not explicitly told not to by the this.props.builder
268
+ // TODO: Design: how to display builder outside of right flyout?
268
269
  return this.props.builder && this.props.rightFlyout && this.expressionInfo.functionCategories && Object.keys(this.expressionInfo.functionCategories).length > 0;
269
270
  }
270
271
 
@@ -339,7 +340,8 @@ class ExpressionControl extends React.Component {
339
340
  </div>
340
341
  </WideFlyout>) : null;
341
342
 
342
- const className = classNames(`properties-expression-editor ${messageType}`, { "properties-light-disabled": this.props.control.light || !this.props.controller.getLight() });
343
+ const className = classNames(`properties-expression-editor ${messageType}`,
344
+ { "properties-light-disabled": !this.props.control.light || !this.props.controller.getLight() || this.props.controller.isTearsheetContainer() });
343
345
 
344
346
  const expressionLink = (<div className="properties-expression-link-container" >
345
347
  {button}
@@ -105,11 +105,10 @@
105
105
 
106
106
  .properties-light-disabled {
107
107
  .CodeMirror {
108
- background: $ui-01;
108
+ background: $field-01;
109
109
  }
110
110
  }
111
111
 
112
-
113
112
  .properties-expression-link-container {
114
113
  display: flex;
115
114
  justify-content: space-between;
@@ -150,7 +150,7 @@ class ListControl extends AbstractTable {
150
150
  selectedRows={this.props.selectedRows}
151
151
  rowSelection={this.props.control.rowSelection}
152
152
  updateRowSelections={this.updateRowSelections}
153
- light={this.props.controller.getLight() && !this.props.control.light}
153
+ light={this.props.controller.getLight() && this.props.control.light && !this.props.controller.isTearsheetContainer()}
154
154
  emptyTablePlaceholder={this.props.control.additionalText}
155
155
  />);
156
156
 
@@ -154,7 +154,7 @@ class MultiSelectControl extends React.Component {
154
154
  onChange={this.handleOnChange}
155
155
  placeholder={label}
156
156
  titleText={this.props.tableControl ? null : this.props.controlItem}
157
- light={this.props.controller.getLight() && !this.props.control.light}
157
+ light={this.props.controller.getLight() && this.props.control.light}
158
158
  />);
159
159
  } else {
160
160
  dropdownComponent = (<MultiSelect
@@ -167,7 +167,7 @@ class MultiSelectControl extends React.Component {
167
167
  onChange={this.handleOnChange}
168
168
  label={label}
169
169
  titleText={this.props.tableControl ? null : this.props.controlItem}
170
- light={this.props.controller.getLight() && !this.props.control.light}
170
+ light={this.props.controller.getLight() && this.props.control.light}
171
171
  />);
172
172
  }
173
173
 
@@ -20,7 +20,8 @@ import { connect } from "react-redux";
20
20
  import { NumberInput, Button } from "carbon-components-react";
21
21
  import ValidationMessage from "./../../components/validation-message";
22
22
  import * as ControlUtils from "./../../util/control-utils";
23
- import { STATES } from "./../../constants/constants.js";
23
+ import { formatMessage } from "./../../util/property-utils";
24
+ import { STATES, MESSAGE_KEYS } from "./../../constants/constants.js";
24
25
  import classNames from "classnames";
25
26
  import { ControlType } from "./../../constants/form-constants";
26
27
  import { Shuffle16 } from "@carbon/icons-react";
@@ -32,6 +33,7 @@ class NumberfieldControl extends React.Component {
32
33
  this.onDirection = this.onDirection.bind(this);
33
34
  this.generateNumber = this.generateNumber.bind(this);
34
35
  this.id = ControlUtils.getControlId(this.props.propertyId);
36
+ this.reactIntl = props.controller.getReactIntl();
35
37
  }
36
38
 
37
39
  onDirection(direction) {
@@ -59,12 +61,34 @@ class NumberfieldControl extends React.Component {
59
61
  this.onDirection(direction);
60
62
  return;
61
63
  }
62
- if (evt.target.validity && evt.target.validity.badInput) {
63
- this.setState({
64
- invalid: true // TODO need to hook into validations
65
- });
64
+
65
+ if (
66
+ evt.target.validity && evt.target.validity.badInput ||
67
+ (!isFinite(evt.target.value))
68
+ ) {
69
+ // Note - When user enters an invalid number, evt.target.value is set to "".
70
+ // It is difficult to differentiate between empty value and invalid input because both return "".
71
+ // It's not possible to add a seaparte condition for invalid input because we never get the actual invalid number entered by the user.
72
+ // So, setting error message for invalid input here instead of using conditions.
73
+ if (this.props.controller.getErrorMessage(this.props.propertyId) === null) {
74
+ const errorMessage = {
75
+ type: "error",
76
+ text: formatMessage(this.reactIntl, MESSAGE_KEYS.INVALID_NUMBER_ERROR),
77
+ propertyId: this.props.propertyId,
78
+ validation_id: "invalid_number"
79
+ };
80
+ this.props.controller.updateErrorMessage(this.props.propertyId, errorMessage);
81
+ }
82
+ // Return without updating property value
66
83
  return;
67
84
  }
85
+ // Number is valid, clear invalid number error if it exists
86
+ const invalidNumberError = this.props.controller.getErrorMessage(this.props.propertyId) !== null &&
87
+ this.props.controller.getErrorMessage(this.props.propertyId).validation_id === "invalid_number";
88
+ if (invalidNumberError) {
89
+ this.props.controller.updateErrorMessage(this.props.propertyId, null);
90
+ }
91
+
68
92
  const actualValue = evt.target.value;
69
93
  if (typeof actualValue === "undefined" || actualValue === null || actualValue === "") {
70
94
  this.props.controller.updatePropertyValue(this.props.propertyId, null);
@@ -125,7 +149,7 @@ class NumberfieldControl extends React.Component {
125
149
  label={this.props.controlItem}
126
150
  hideLabel={this.props.tableControl}
127
151
  allowEmpty
128
- light={this.props.controller.getLight() && !this.props.control.light}
152
+ light={this.props.controller.getLight() && this.props.control.light}
129
153
  hideSteppers={this.props.tableControl || (this.props.control.controlType === ControlType.NUMBERFIELD)}
130
154
  />
131
155
  {numberGenerator}
@@ -20,8 +20,9 @@ import { connect } from "react-redux";
20
20
  import { PasswordInput, Form } from "carbon-components-react";
21
21
  import ValidationMessage from "./../../components/validation-message";
22
22
  import * as ControlUtils from "./../../util/control-utils";
23
- import { STATES } from "./../../constants/constants.js";
23
+ import { STATES, MESSAGE_KEYS } from "./../../constants/constants.js";
24
24
  import classNames from "classnames";
25
+ import { formatMessage } from "./../../util/property-utils";
25
26
 
26
27
  class PasswordControl extends React.Component {
27
28
  constructor(props) {
@@ -34,6 +35,14 @@ class PasswordControl extends React.Component {
34
35
  }
35
36
 
36
37
  render() {
38
+ const overrideShowPasswordLabel = `${this.props.control.name}.passwordShow.tooltip`;
39
+ const overrideHidePasswordLabel = `${this.props.control.name}.passwordHide.tooltip`;
40
+
41
+ const defaultShowPasswordLabel = formatMessage(this.reactIntl, MESSAGE_KEYS.SHOW_PASSWORD_TOOLTIP);
42
+ const defaultHidePasswordLabel = formatMessage(this.reactIntl, MESSAGE_KEYS.HIDE_PASSWORD_TOOLTIP);
43
+
44
+ const showPasswordLabel = this.props.controller.getResource(overrideShowPasswordLabel, defaultShowPasswordLabel);
45
+ const hidePasswordLabel = this.props.controller.getResource(overrideHidePasswordLabel, defaultHidePasswordLabel);
37
46
  const value = this.props.value ? this.props.value : "";
38
47
  const className = classNames("properties-pwdfield", "properties-input-control", { "hide": this.props.state === STATES.HIDDEN },
39
48
  this.props.messageInfo ? this.props.messageInfo.type : null);
@@ -51,8 +60,10 @@ class PasswordControl extends React.Component {
51
60
  value={value}
52
61
  labelText={this.props.controlItem}
53
62
  hideLabel={this.props.tableControl}
54
- light={this.props.controller.getLight() && !this.props.control.light}
63
+ light={this.props.controller.getLight() && this.props.control.light}
55
64
  tooltipAlignment="end"
65
+ showPasswordLabel={showPasswordLabel}
66
+ hidePasswordLabel={hidePasswordLabel}
56
67
  />
57
68
  </Form>
58
69
  <ValidationMessage inTable={this.props.tableControl} tableOnly state={this.props.state} messageInfo={this.props.messageInfo} />