@elyra/canvas 12.21.0 → 12.22.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 (39) hide show
  1. package/dist/common-canvas.es.js +1 -1
  2. package/dist/common-canvas.js +1 -1
  3. package/dist/common-properties-597dd249.js +2 -0
  4. package/dist/common-properties-597dd249.js.map +1 -0
  5. package/dist/common-properties-de0ca66b.js +2 -0
  6. package/dist/common-properties-de0ca66b.js.map +1 -0
  7. package/dist/lib/properties.es.js +1 -1
  8. package/dist/lib/properties.js +1 -1
  9. package/dist/styles/common-canvas.min.css +1 -1
  10. package/dist/styles/common-canvas.min.css.map +1 -1
  11. package/package.json +1 -1
  12. package/src/common-properties/components/editor-form/editor-form.jsx +54 -21
  13. package/src/common-properties/components/flexible-table/flexible-table.scss +2 -2
  14. package/src/common-properties/controls/datefield/datefield.jsx +1 -1
  15. package/src/common-properties/controls/dropdown/dropdown.jsx +3 -3
  16. package/src/common-properties/controls/expression/expression.jsx +1 -1
  17. package/src/common-properties/controls/list/list.jsx +1 -1
  18. package/src/common-properties/controls/multiselect/multiselect.jsx +2 -2
  19. package/src/common-properties/controls/numberfield/numberfield.jsx +1 -1
  20. package/src/common-properties/controls/passwordfield/passwordfield.jsx +1 -1
  21. package/src/common-properties/controls/selectcolumns/selectcolumns.jsx +1 -1
  22. package/src/common-properties/controls/someofselect/someofselect.jsx +1 -1
  23. package/src/common-properties/controls/textarea/textarea.jsx +2 -2
  24. package/src/common-properties/controls/textfield/textfield.jsx +1 -1
  25. package/src/common-properties/controls/timefield/timefield.jsx +1 -1
  26. package/src/common-properties/form/ControlInfo.js +1 -0
  27. package/src/common-properties/form/EditorForm.js +14 -9
  28. package/src/common-properties/index.scss +5 -0
  29. package/src/common-properties/panels/tearsheet/tearsheet.jsx +9 -22
  30. package/src/common-properties/panels/tearsheet/tearsheet.scss +7 -1
  31. package/src/common-properties/properties-controller.js +6 -2
  32. package/src/common-properties/ui-conditions/ui-conditions-parser.js +1 -0
  33. package/src/common-properties/ui-conditions/ui-groups-parser.js +1 -0
  34. package/src/palette/palette.scss +1 -1
  35. package/stats.html +1 -1
  36. package/dist/common-properties-267a9a6c.js +0 -2
  37. package/dist/common-properties-267a9a6c.js.map +0 -1
  38. package/dist/common-properties-6520f90b.js +0 -2
  39. package/dist/common-properties-6520f90b.js.map +0 -1
@@ -41,9 +41,9 @@ import ActionPanel from "./../../panels/action-panel";
41
41
 
42
42
  import ActionFactory from "./../../actions/action-factory";
43
43
  import Icon from "./../../../icons/icon";
44
+ import { ItemType } from "../../constants/form-constants";
44
45
 
45
46
  const ALERT_TAB_GROUP = "alertMsgs";
46
-
47
47
  class EditorForm extends React.Component {
48
48
 
49
49
  constructor(props) {
@@ -70,6 +70,10 @@ class EditorForm extends React.Component {
70
70
 
71
71
  this.actionFactory = new ActionFactory(this.props.controller);
72
72
 
73
+ this.FIRST_TEARSHEET_ID = null;
74
+ this.TEARSHEETS = {};
75
+ this.visibleTearsheet = null;
76
+
73
77
  }
74
78
 
75
79
  shouldComponentUpdate(nextProps, nextState) {
@@ -129,9 +133,12 @@ class EditorForm extends React.Component {
129
133
  const tabContent = [];
130
134
  let hasAlertsTab = false;
131
135
  let modalSelected = 0;
136
+ const nonTearsheetTabs = tabs.filter((t) => t.content.itemType !== ItemType.TEARSHEET);
137
+ const tearsheetTabs = tabs.filter((t) => t.content.itemType === ItemType.TEARSHEET);
138
+ const totalTabs = tearsheetTabs.concat(nonTearsheetTabs);
132
139
 
133
- for (let i = 0; i < tabs.length; i++) {
134
- const tab = tabs[i];
140
+ for (let i = 0; i < totalTabs.length; i++) {
141
+ const tab = totalTabs[i];
135
142
  const tabState = this.props.controller.getPanelState({ name: tab.group });
136
143
  if (tabState === STATES.HIDDEN) {
137
144
  continue;
@@ -144,8 +151,9 @@ class EditorForm extends React.Component {
144
151
  if (this.props.additionalComponents) {
145
152
  additionalComponent = this.props.additionalComponents[tab.group];
146
153
  }
147
- // if only 1 tab don't show any tabs
148
- if (tabs.length === 1) {
154
+ // if only 1 tab AND
155
+ // if total non-tearsheet tabs is 1; don't show any tabs
156
+ if (totalTabs.length === 1 && nonTearsheetTabs.length === 1) {
149
157
  return (
150
158
  <div key={"cat." + key} className="properties-category">
151
159
  {panelItems}
@@ -160,20 +168,31 @@ class EditorForm extends React.Component {
160
168
  panelArrow = <Icon type={CARBON_ICONS.CHEVRONARROWS.UP} className="properties-category-caret-up" />;
161
169
  categoryOpen = true;
162
170
  }
163
- tabContent.push(
164
- <div key={this._getContainerIndex(hasAlertsTab, i) + "-" + key} className="properties-category-container">
165
- <button type="button" onClick={this._showCategoryPanel.bind(this, tab.group)}
166
- className={classNames("properties-category-title", { "properties-light-enabled": this.props.controller.getLight() }) }
167
- >
168
- {tab.text}{this._getMessageCountForCategory(tab)}
169
- {panelArrow}
170
- </button>
171
- <div className={classNames("properties-category-content", { "show": categoryOpen }) }>
171
+ if (tab.content.itemType !== ItemType.TEARSHEET && nonTearsheetTabs.length === 1) {
172
+ tabContent.push(
173
+ <div key={"cat." + key} className="properties-category">
172
174
  {panelItems}
173
175
  {additionalComponent}
174
176
  </div>
175
- </div>
176
- );
177
+ );
178
+ } else {
179
+ tabContent.push(
180
+ <div key={this._getContainerIndex(hasAlertsTab, i) + "-" + key}
181
+ className={classNames("properties-category-container", { "properties-hidden-container": tab.content.itemType === ItemType.TEARSHEET })}
182
+ >
183
+ <button type="button" onClick={this._showCategoryPanel.bind(this, tab.group)}
184
+ className={classNames("properties-category-title", { "properties-light-enabled": this.props.controller.getLight() }) }
185
+ >
186
+ {tab.text}{this._getMessageCountForCategory(tab)}
187
+ {panelArrow}
188
+ </button>
189
+ <div className={classNames("properties-category-content", { "show": categoryOpen }) }>
190
+ {panelItems}
191
+ {additionalComponent}
192
+ </div>
193
+ </div>
194
+ );
195
+ }
177
196
  } else {
178
197
  if (this.props.activeTab === tab.group) {
179
198
  modalSelected = i;
@@ -183,6 +202,7 @@ class EditorForm extends React.Component {
183
202
  key={this._getContainerIndex(hasAlertsTab, i) + "-" + key}
184
203
  tabIndex={i}
185
204
  label={tab.text}
205
+ className={classNames({ "properties-hidden-container": tab.content.itemType === ItemType.TEARSHEET })}
186
206
  onClick={this._modalTabsOnClick.bind(this, tab.group)}
187
207
  >
188
208
  {panelItems}
@@ -434,15 +454,28 @@ class EditorForm extends React.Component {
434
454
  {content}
435
455
  </TwistyPanel>);
436
456
  case ("tearsheet"):
437
- if (this.props.controller.getActiveTearsheet() === panel.id) {
457
+ if (!this.TEARSHEETS[panel.id]) {
458
+ this.TEARSHEETS[panel.id] = {
459
+ panel: panel,
460
+ title: panel.label,
461
+ description: panel.description ? panel.description.text : null,
462
+ content: content
463
+ };
464
+ }
465
+ if (this.props.controller.getActiveTearsheet() !== null) {
466
+ this.visibleTearsheet = this.TEARSHEETS[this.props.controller.getActiveTearsheet()];
467
+ } else {
468
+ this.visibleTearsheet = null;
469
+ }
470
+ if (!this.FIRST_TEARSHEET_ID || this.FIRST_TEARSHEET_ID === panel.id) {
471
+ this.FIRST_TEARSHEET_ID = panel.id;
438
472
  return (
439
473
  <TearSheet
474
+ open={this.props.controller.getActiveTearsheet() !== null}
440
475
  key={panel.id}
441
476
  controller={this.props.controller}
442
- panel={panel}
443
- >
444
- {content}
445
- </TearSheet>
477
+ tearsheet={this.visibleTearsheet}
478
+ />
446
479
  );
447
480
  }
448
481
  return null;
@@ -40,7 +40,7 @@ $row-left-padding: $spacing-02;
40
40
  }
41
41
 
42
42
  .properties-ft-container-panel {
43
- height: calc(100% - $spacing-07); // adjust height for table header
43
+ height: calc(100% - #{$spacing-07}); // adjust height for table header
44
44
  }
45
45
 
46
46
  .properties-ft-control-container {
@@ -130,7 +130,7 @@ $row-left-padding: $spacing-02;
130
130
  }
131
131
 
132
132
  .properties-ft-empty-table {
133
- height: calc($spacing-11 + $spacing-08);
133
+ height: calc(#{$spacing-11} + #{$spacing-08});
134
134
  display: flex;
135
135
  justify-content: center;
136
136
  align-items: center;
@@ -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()}
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()}
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()}
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()}
240
+ light={this.props.controller.getLight() && !this.props.control.light}
241
241
  translateWithId={(id) => listBoxMenuIconTranslationIds[id]}
242
242
  titleText={this.props.controlItem}
243
243
  />);
@@ -339,7 +339,7 @@ class ExpressionControl extends React.Component {
339
339
  </div>
340
340
  </WideFlyout>) : null;
341
341
 
342
- const className = classNames(`properties-expression-editor ${messageType}`, { "properties-light-disabled": !this.props.controller.getLight() });
342
+ const className = classNames(`properties-expression-editor ${messageType}`, { "properties-light-disabled": this.props.control.light || !this.props.controller.getLight() });
343
343
 
344
344
  const expressionLink = (<div className="properties-expression-link-container" >
345
345
  {button}
@@ -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()}
153
+ light={this.props.controller.getLight() && !this.props.control.light}
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()}
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()}
170
+ light={this.props.controller.getLight() && !this.props.control.light}
171
171
  />);
172
172
  }
173
173
 
@@ -125,7 +125,7 @@ class NumberfieldControl extends React.Component {
125
125
  label={this.props.controlItem}
126
126
  hideLabel={this.props.tableControl}
127
127
  allowEmpty
128
- light={this.props.controller.getLight()}
128
+ light={this.props.controller.getLight() && !this.props.control.light}
129
129
  hideSteppers={this.props.tableControl || (this.props.control.controlType === ControlType.NUMBERFIELD)}
130
130
  />
131
131
  {numberGenerator}
@@ -51,7 +51,7 @@ class PasswordControl extends React.Component {
51
51
  value={value}
52
52
  labelText={this.props.controlItem}
53
53
  hideLabel={this.props.tableControl}
54
- light={this.props.controller.getLight()}
54
+ light={this.props.controller.getLight() && !this.props.control.light}
55
55
  tooltipAlignment="end"
56
56
  />
57
57
  </Form>
@@ -137,7 +137,7 @@ class SelectColumnsControl extends AbstractTable {
137
137
  selectedRows={this.props.selectedRows}
138
138
  rowSelection={this.props.control.rowSelection}
139
139
  updateRowSelections={this.updateRowSelections}
140
- light={this.props.controller.getLight()}
140
+ light={this.props.controller.getLight() && !this.props.control.light}
141
141
  emptyTablePlaceholder={this.props.control.additionalText}
142
142
  />);
143
143
 
@@ -109,7 +109,7 @@ class SomeofselectControl extends React.Component {
109
109
  updateRowSelections={this.updateSelections}
110
110
  selectable
111
111
  showHeader={false}
112
- light={this.props.controller.getLight()}
112
+ light={this.props.controller.getLight() && !this.props.control.light}
113
113
  emptyTablePlaceholder={this.props.control.additionalText}
114
114
  />
115
115
  <ValidationMessage state={this.props.state} messageInfo={this.props.messageInfo} inTable={this.props.tableControl} />
@@ -78,7 +78,7 @@ class TextareaControl extends React.Component {
78
78
  value={value}
79
79
  labelText={this.props.controlItem}
80
80
  hideLabel={this.props.tableControl}
81
- light={this.props.controller.getLight()}
81
+ light={this.props.controller.getLight() && !this.props.control.light}
82
82
  />
83
83
  <ValidationMessage inTable={this.props.tableControl} tableOnly={!showValidationMessage} state={""} messageInfo={errorMessage} />
84
84
  </div>);
@@ -92,7 +92,7 @@ class TextareaControl extends React.Component {
92
92
  value={value}
93
93
  labelText={this.props.controlItem}
94
94
  hideLabel={this.props.tableControl}
95
- light={this.props.controller.getLight()}
95
+ light={this.props.controller.getLight() && !this.props.control.light}
96
96
  />);
97
97
  }
98
98
 
@@ -103,7 +103,7 @@ class TextfieldControl extends React.Component {
103
103
  value={value}
104
104
  labelText={this.props.controlItem}
105
105
  hideLabel={this.props.tableControl}
106
- light={this.props.controller.getLight()}
106
+ light={this.props.controller.getLight() && !this.props.control.light}
107
107
  />);
108
108
  }
109
109
 
@@ -81,7 +81,7 @@ class TimefieldControl extends React.Component {
81
81
  value={this.value}
82
82
  labelText={this.props.controlItem}
83
83
  hideLabel={this.props.tableControl}
84
- light={this.props.controller.getLight()}
84
+ light={this.props.controller.getLight() && !this.props.control.light}
85
85
  />
86
86
  <ValidationMessage inTable={this.props.tableControl} tableOnly state={this.props.state} messageInfo={this.props.messageInfo} />
87
87
  </div>
@@ -184,5 +184,6 @@ export class Control {
184
184
  if (settings.buttons) {
185
185
  this.buttons = settings.buttons;
186
186
  }
187
+ this.light = settings.light || false;
187
188
  }
188
189
  }
@@ -135,7 +135,7 @@ function makePrimaryTab(propertyDef, group, l10nProvider) {
135
135
  return new EditorTab(label, group.name, _makeUIItem(propertyDef.parameterMetadata, propertyDef.actionMetadata, group, propertyDef.structureMetadata, l10nProvider));
136
136
  }
137
137
 
138
- function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider) {
138
+ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider, light = false) {
139
139
  const groupName = group.name;
140
140
  let groupItem = null;
141
141
  let groupLabel = null;
@@ -144,7 +144,7 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
144
144
  switch (group.groupType()) {
145
145
  case GroupType.CONTROLS:
146
146
  return UIItem.makePanel(new ControlPanel(groupName, PanelType.GENERAL, groupClassName, nestedPanel,
147
- _makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider)));
147
+ _makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider, light)));
148
148
  case GroupType.COLUMN_SELECTION:
149
149
  return UIItem.makePanel(new ControlPanel(groupName, PanelType.COLUMN_SELECTION, groupClassName, nestedPanel,
150
150
  _makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider)));
@@ -240,14 +240,18 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
240
240
  }
241
241
  case GroupType.TEARSHEET_PANEL: {
242
242
  groupLabel = l10nProvider.l10nLabel(group, group.name);
243
+ let groupDesc;
244
+ if (group.description) {
245
+ groupDesc = new Description(l10nProvider.l10nResource(group.description));
246
+ }
243
247
  const panSubItems = [];
244
248
  if (Array.isArray(group.subGroups)) {
245
249
  group.subGroups.forEach(function(subGroup) {
246
- groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider);
250
+ groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider, true);
247
251
  panSubItems.push(groupItem);
248
252
  });
249
253
  }
250
- return UIItem.makeTearsheetPanel(new ControlPanel(groupName, PanelType.TEARSHEET, groupClassName, nestedPanel, panSubItems, groupLabel, false), group.description);
254
+ return UIItem.makeTearsheetPanel(new ControlPanel(groupName, PanelType.TEARSHEET, groupClassName, nestedPanel, panSubItems, groupLabel, false), groupDesc);
251
255
  }
252
256
  default:
253
257
  logger.warn("(Unknown group type '" + group.groupType() + "')");
@@ -258,7 +262,7 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
258
262
  /**
259
263
  * Called on a base property group.
260
264
  */
261
- function _makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider) {
265
+ function _makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider, light = false) {
262
266
  const uiItems = [];
263
267
  const panelInsertedFor = [];
264
268
  if (!Array.isArray(group.parameterNames())) {
@@ -272,7 +276,7 @@ function _makeControls(parameterMetadata, actionMetadata, group, structureMetada
272
276
  structureDef = structureMetadata.getStructure(prop.baseType());
273
277
  }
274
278
  if (!(group instanceof StructureDef) || (group instanceof StructureDef && prop.isSubPanelEdit())) {
275
- const ctrl = _makeControl(parameterMetadata, paramName, group, structureDef, l10nProvider, actionMetadata, structureMetadata);
279
+ const ctrl = _makeControl(parameterMetadata, paramName, group, structureDef, l10nProvider, actionMetadata, structureMetadata, null, light);
276
280
  const control = UIItem.makeControl(ctrl);
277
281
  if (prop.separatorBefore()) {
278
282
  uiItems.push(UIItem.makeHSeparator());
@@ -316,7 +320,7 @@ function _makeControls(parameterMetadata, actionMetadata, group, structureMetada
316
320
  if (Array.isArray(group.subGroups)) {
317
321
  group.subGroups.forEach(function(subGroup) {
318
322
  if (!_hasPanelBeenInserted(panelInsertedFor, subGroup.dependsOn)) {
319
- const uiItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider);
323
+ const uiItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider, light);
320
324
  uiItems.push(uiItem);
321
325
  }
322
326
  });
@@ -411,8 +415,8 @@ function _makeStringControl(parameter, isSubControl) {
411
415
  /**
412
416
  * Creates a control for the supplied property.
413
417
  */
414
- function _makeControl(parameterMetadata, paramName, group, structureDefinition, l10nProvider, actionMetadata, structureMetadata, subControl) {
415
- const isSubControl = typeof subControl !== "undefined";
418
+ function _makeControl(parameterMetadata, paramName, group, structureDefinition, l10nProvider, actionMetadata, structureMetadata, subControl, light = false) {
419
+ const isSubControl = typeof subControl !== "undefined" && subControl;
416
420
 
417
421
  // Assume the property is defined
418
422
  const parameter = isSubControl ? subControl : parameterMetadata.getParameter(paramName);
@@ -637,6 +641,7 @@ function _makeControl(parameterMetadata, paramName, group, structureDefinition,
637
641
  settings.customValueAllowed = parameter.customValueAllowed;
638
642
  settings.className = parameter.className;
639
643
  settings.buttons = buttons;
644
+ settings.light = light;
640
645
  if (isSubControl) {
641
646
  settings.visible = parameter.visible;
642
647
  settings.width = parameter.columns(8);
@@ -49,6 +49,11 @@
49
49
  align-items: left;
50
50
  }
51
51
 
52
+ .bx--tabs--scrollable .bx--tabs--scrollable__nav-item.properties-hidden-container,
53
+ .properties-hidden-container {
54
+ display: none;
55
+ }
56
+
52
57
  .properties-modal-error {
53
58
  button:first-of-type { // hides the secondary button
54
59
  display: none;
@@ -4,51 +4,38 @@ import { ComposedModal, ModalHeader, ModalBody } from "carbon-components-react";
4
4
  import { Portal } from "react-portal";
5
5
 
6
6
  class TearSheet extends Component {
7
- constructor(props) {
8
- super(props);
9
- this.state = {
10
- open: false
11
- };
12
- }
13
- componentDidMount() {
14
- setTimeout(() => {
15
- this.setState({
16
- open: true
17
- });
18
- }, 0);
19
- }
20
7
  render() {
21
- const title = this.props.panel.label ? this.props.panel.label : null;
22
- const description = this.props.panel.description ? this.props.panel.description.default : null;
8
+ const title = this.props.tearsheet ? this.props.tearsheet.title : null;
9
+ const description = this.props.tearsheet ? this.props.tearsheet.description : null;
10
+ const content = this.props.tearsheet ? this.props.tearsheet.content : null;
23
11
  return (
24
12
  <Portal>
25
13
  <ComposedModal
26
14
  className="properties-tearsheet-panel"
27
- open={this.state.open}
15
+ open={this.props.open}
28
16
  size="lg"
29
17
  preventCloseOnClickOutside
30
18
  >
31
19
  <ModalHeader
32
20
  title={title}
33
21
  buttonOnClick={() => {
34
- setTimeout(() => {
35
- this.props.controller.clearActiveTearsheet();
36
- }, 500);
22
+ this.props.controller.clearActiveTearsheet();
37
23
  }}
38
24
  >
39
25
  {description ? (<p>{description}</p>) : null}
40
26
  </ModalHeader>
41
27
  <ModalBody>
42
- {this.props.children}
28
+ {content}
43
29
  </ModalBody>
44
30
  </ComposedModal>
45
31
  </Portal>);
46
32
  }
47
33
  }
48
34
  TearSheet.propTypes = {
49
- panel: PropTypes.object.isRequired,
35
+ open: PropTypes.bool,
50
36
  controller: PropTypes.object.isRequired,
51
- children: PropTypes.array
37
+ children: PropTypes.array,
38
+ tearsheet: PropTypes.object
52
39
  };
53
40
 
54
41
  export default TearSheet;
@@ -1,5 +1,11 @@
1
1
  .properties-tearsheet-panel.bx--modal {
2
2
  align-items: flex-end;
3
+ &.is-visible {
4
+ .bx--modal-container {
5
+ transform: translate3d(0, 0, 0);
6
+ transition: transform 240ms cubic-bezier(0, 0, 0.3, 1);
7
+ }
8
+ }
3
9
  .bx--modal-container {
4
10
  max-height: calc(100% - 88px);
5
11
  height: 100%;
@@ -22,7 +28,7 @@
22
28
  padding: $spacing-06 $spacing-07;
23
29
  background-color: $ui-background;
24
30
  margin-bottom: 0;
25
- .react-codemirror2, .react-codemirror2 .CodeMirror {
31
+ .bx--multi-select, .bx--dropdown, .bx--number input[type=number], .bx--text-input, .bx--text-area { // override carbon's modal
26
32
  background-color: $ui-01;
27
33
  }
28
34
  }
@@ -31,7 +31,7 @@ import { Type, ParamRole, ControlType } 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
-
34
+ import { ItemType } from "./constants/form-constants";
35
35
  export default class PropertiesController {
36
36
 
37
37
  constructor() {
@@ -180,7 +180,11 @@ export default class PropertiesController {
180
180
  this.uiItems = this.form.uiItems; // set last so properties dialog doesn't render too early
181
181
  // set initial tab to first tab
182
182
  if (!isEmpty(this.uiItems) && !isEmpty(this.uiItems[0].tabs)) {
183
- this.propertiesStore.setActiveTab(this.uiItems[0].tabs[0].group);
183
+ // active tab is the first non-tearsheet
184
+ const filteredTearsheets = this.uiItems[0].tabs.filter((tab) => tab.content.itemType !== ItemType.TEARSHEET);
185
+ if (filteredTearsheets.length) {
186
+ this.propertiesStore.setActiveTab(filteredTearsheets[0].group);
187
+ }
184
188
  }
185
189
 
186
190
  // set title
@@ -193,6 +193,7 @@ function parseUiItem(controls, actions, uiItem, panelId, parentCategoryId) {
193
193
  break;
194
194
  case ItemType.STATIC_TEXT:
195
195
  case ItemType.TEXT_PANEL:
196
+ case ItemType.TEARSHEET:
196
197
  case ItemType.HORIZONTAL_SEPARATOR: {
197
198
  break;
198
199
  }
@@ -93,6 +93,7 @@ function parseUiItem(panelTree, uiItem, currentPanel) {
93
93
  break;
94
94
  }
95
95
  case ItemType.STATIC_TEXT:
96
+ case ItemType.TEARSHEET:
96
97
  case ItemType.HORIZONTAL_SEPARATOR: {
97
98
  break;
98
99
  }
@@ -182,7 +182,7 @@ $palette-search-container-height: 41px;
182
182
  }
183
183
 
184
184
  .palette-flyout-categories {
185
- height: calc(100% - $palette-search-container-height);
185
+ height: calc(100% - #{$palette-search-container-height});
186
186
  width: 100%;
187
187
  position: absolute;
188
188
  overflow-x: hidden;