@elyra/canvas 12.24.0 → 12.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{canvas-controller-6239cacc.js → canvas-controller-1cf8e066.js} +2 -2
- package/dist/{canvas-controller-6239cacc.js.map → canvas-controller-1cf8e066.js.map} +1 -1
- package/dist/{canvas-controller-60ed1f25.js → canvas-controller-873a2800.js} +2 -2
- package/dist/{canvas-controller-60ed1f25.js.map → canvas-controller-873a2800.js.map} +1 -1
- package/dist/common-canvas-4c204462.js +2 -0
- package/dist/common-canvas-4c204462.js.map +1 -0
- package/dist/common-canvas-9e2687b3.js +2 -0
- package/dist/common-canvas-9e2687b3.js.map +1 -0
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/common-properties-478094f0.js +2 -0
- package/dist/common-properties-478094f0.js.map +1 -0
- package/dist/common-properties-648d23a3.js +2 -0
- package/dist/common-properties-648d23a3.js.map +1 -0
- package/dist/{datarecord-metadata-v3-schema-3323a91e.js → datarecord-metadata-v3-schema-6a3754ce.js} +1 -1
- package/dist/{datarecord-metadata-v3-schema-3323a91e.js.map → datarecord-metadata-v3-schema-6a3754ce.js.map} +1 -1
- package/dist/{datarecord-metadata-v3-schema-93ec5562.js → datarecord-metadata-v3-schema-ba1f2849.js} +1 -1
- package/dist/{datarecord-metadata-v3-schema-93ec5562.js.map → datarecord-metadata-v3-schema-ba1f2849.js.map} +1 -1
- package/dist/extends-3cb3faa3.js +7 -0
- package/dist/{extends-11efb86b.js.map → extends-3cb3faa3.js.map} +1 -1
- package/dist/{extends-bb395e42.js → extends-858c1544.js} +2 -2
- package/dist/{extends-bb395e42.js.map → extends-858c1544.js.map} +1 -1
- package/dist/{flexible-table-d51a7d72.js → flexible-table-8d16ca9e.js} +2 -2
- package/dist/{flexible-table-d51a7d72.js.map → flexible-table-8d16ca9e.js.map} +1 -1
- package/dist/flexible-table-984c1cb1.js +2 -0
- package/dist/{flexible-table-989859ec.js.map → flexible-table-984c1cb1.js.map} +1 -1
- package/dist/{icon-b619470c.js → icon-18729ae8.js} +2 -2
- package/dist/{icon-b619470c.js.map → icon-18729ae8.js.map} +1 -1
- package/dist/{icon-037ad6d1.js → icon-53450584.js} +2 -2
- package/dist/{icon-037ad6d1.js.map → icon-53450584.js.map} +1 -1
- package/dist/index-621d121a.js +2 -0
- package/dist/index-621d121a.js.map +1 -0
- package/dist/{index-46a80c08.js → index-d2d9aa72.js} +2 -2
- package/dist/index-d2d9aa72.js.map +1 -0
- package/dist/lib/canvas-controller.es.js +1 -1
- package/dist/lib/canvas-controller.js +1 -1
- package/dist/lib/canvas.es.js +1 -1
- package/dist/lib/canvas.js +1 -1
- package/dist/lib/context-menu.es.js +1 -1
- package/dist/lib/context-menu.es.js.map +1 -1
- package/dist/lib/context-menu.js +1 -1
- package/dist/lib/context-menu.js.map +1 -1
- package/dist/lib/properties/field-picker.es.js +1 -1
- package/dist/lib/properties/field-picker.js +1 -1
- package/dist/lib/properties/flexible-table.es.js +1 -1
- package/dist/lib/properties/flexible-table.js +1 -1
- package/dist/lib/properties.es.js +1 -1
- package/dist/lib/properties.js +1 -1
- package/dist/styles/common-canvas.min.css +1 -1
- package/dist/styles/common-canvas.min.css.map +1 -1
- package/dist/{toolbar-e4c551ae.js → toolbar-245632a5.js} +2 -2
- package/dist/{toolbar-e4c551ae.js.map → toolbar-245632a5.js.map} +1 -1
- package/dist/{toolbar-3f93ec4b.js → toolbar-9f4bb202.js} +2 -2
- package/dist/{toolbar-3f93ec4b.js.map → toolbar-9f4bb202.js.map} +1 -1
- package/package.json +1 -1
- package/src/common-canvas/canvas-controller.js +9 -0
- package/src/common-canvas/cc-contents.jsx +33 -11
- package/src/common-canvas/svg-canvas-d3.js +14 -4
- package/src/common-canvas/svg-canvas-d3.scss +4 -0
- package/src/common-canvas/svg-canvas-pipeline.js +65 -3
- package/src/common-canvas/svg-canvas-renderer.js +107 -179
- package/src/common-canvas/svg-canvas-utils-display.js +6 -4
- package/src/common-properties/components/editor-form/editor-form.jsx +24 -11
- package/src/common-properties/components/editor-form/editor-form.scss +0 -5
- package/src/common-properties/components/field-picker/field-picker.scss +13 -2
- package/src/common-properties/components/properties-modal/properties-modal.jsx +1 -1
- package/src/common-properties/components/properties-modal/properties-modal.scss +1 -1
- package/src/common-properties/constants/constants.js +6 -0
- package/src/common-properties/constants/form-constants.js +1 -0
- package/src/common-properties/controls/abstract-table.jsx +1 -1
- package/src/common-properties/controls/control-factory.js +9 -3
- package/src/common-properties/controls/expression/expression.jsx +2 -2
- package/src/common-properties/controls/list/list.jsx +1 -1
- package/src/common-properties/controls/selectcolumns/selectcolumns.jsx +1 -1
- package/src/common-properties/controls/someofselect/someofselect.jsx +1 -1
- package/src/common-properties/form/EditorForm.js +42 -28
- package/src/common-properties/form/Form.js +5 -3
- package/src/common-properties/panels/sub-panel/sub-panel.scss +4 -0
- package/src/common-properties/panels/tearsheet/tearsheet.jsx +4 -2
- package/src/common-properties/panels/tearsheet/tearsheet.scss +7 -0
- package/src/common-properties/properties-controller.js +4 -3
- package/src/common-properties/properties-main/properties-main-widths.scss +2 -0
- package/src/common-properties/properties-main/properties-main.jsx +42 -6
- package/src/common-properties/properties-main/properties-main.scss +3 -0
- package/src/object-model/object-model.js +15 -0
- package/src/object-model/redux/canvas-store.js +1 -1
- package/stats.html +1 -1
- package/dist/common-canvas-4ae99af6.js +0 -2
- package/dist/common-canvas-4ae99af6.js.map +0 -1
- package/dist/common-canvas-86633e44.js +0 -2
- package/dist/common-canvas-86633e44.js.map +0 -1
- package/dist/common-properties-2bc0b14a.js +0 -2
- package/dist/common-properties-2bc0b14a.js.map +0 -1
- package/dist/common-properties-56bf68a6.js +0 -2
- package/dist/common-properties-56bf68a6.js.map +0 -1
- package/dist/extends-11efb86b.js +0 -7
- package/dist/flexible-table-989859ec.js +0 -2
- package/dist/index-46a80c08.js.map +0 -1
- package/dist/index-b527a82d.js +0 -2
- package/dist/index-b527a82d.js.map +0 -1
|
@@ -614,22 +614,34 @@ class EditorForm extends React.Component {
|
|
|
614
614
|
|
|
615
615
|
let content = this.genUIContent(uiItems);
|
|
616
616
|
let wideFly = <div />;
|
|
617
|
+
let stackedTearsheet;
|
|
617
618
|
|
|
618
619
|
const form = this.props.controller.getForm();
|
|
619
620
|
const title = PropertyUtil.formatMessage(this.props.controller.getReactIntl(),
|
|
620
621
|
MESSAGE_KEYS.FIELDPICKER_SAVEBUTTON_LABEL) + " " + form.label;
|
|
621
622
|
|
|
622
|
-
if (this.
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
623
|
+
if (this.state.showFieldPicker) {
|
|
624
|
+
if (this.props.rightFlyout) {
|
|
625
|
+
wideFly = (<WideFlyout
|
|
626
|
+
showPropertiesButtons={false}
|
|
627
|
+
show
|
|
628
|
+
title={title}
|
|
629
|
+
light={this.props.controller.getLight()}
|
|
630
|
+
>
|
|
631
|
+
{this.fieldPicker(title)}
|
|
632
|
+
</WideFlyout>);
|
|
633
|
+
} else if (this.props.controller.isTearsheetContainer()) {
|
|
634
|
+
stackedTearsheet = (<TearSheet
|
|
635
|
+
open
|
|
636
|
+
stacked
|
|
637
|
+
tearsheet={{
|
|
638
|
+
title: title,
|
|
639
|
+
content: this.fieldPicker()
|
|
640
|
+
}}
|
|
641
|
+
/>);
|
|
642
|
+
} else {
|
|
643
|
+
content = this.fieldPicker(title);
|
|
644
|
+
}
|
|
633
645
|
}
|
|
634
646
|
|
|
635
647
|
return (
|
|
@@ -639,6 +651,7 @@ class EditorForm extends React.Component {
|
|
|
639
651
|
>
|
|
640
652
|
{content}
|
|
641
653
|
{wideFly}
|
|
654
|
+
{stackedTearsheet}
|
|
642
655
|
</div>
|
|
643
656
|
);
|
|
644
657
|
}
|
|
@@ -98,13 +98,24 @@
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
// This is for field-picker in properties-modal, containerType="Modal"
|
|
101
|
-
.properties-modal
|
|
101
|
+
.properties-modal {
|
|
102
102
|
.properties-fp-table {
|
|
103
103
|
padding-bottom: $spacing-06;
|
|
104
104
|
margin-bottom: $spacing-10; // Accommodate footer buttons
|
|
105
105
|
|
|
106
106
|
.properties-fp-top-row {
|
|
107
|
-
|
|
107
|
+
justify-content: flex-end;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// This is for field-picker in tearsheet, containerType="Tearsheet"
|
|
113
|
+
.properties-tearsheet-panel.bx--modal {
|
|
114
|
+
.properties-fp-table {
|
|
115
|
+
border-top: 1px solid $ui-03;
|
|
116
|
+
padding: $spacing-05;
|
|
117
|
+
|
|
118
|
+
.properties-fp-top-row {
|
|
108
119
|
justify-content: flex-end;
|
|
109
120
|
}
|
|
110
121
|
|
|
@@ -29,6 +29,7 @@ export default class PropertiesModal extends Component {
|
|
|
29
29
|
switch (this.props.bsSize) {
|
|
30
30
|
case Size.SMALL: return CARBON_MODAL_SIZE_XSMALL;
|
|
31
31
|
case Size.LARGE: return CARBON_MODAL_SIZE_LARGE;
|
|
32
|
+
case Size.MAX: return CARBON_MODAL_SIZE_LARGE;
|
|
32
33
|
case Size.MEDIUM:
|
|
33
34
|
default: return CARBON_MODAL_SIZE_SMALL;
|
|
34
35
|
}
|
|
@@ -70,4 +71,3 @@ PropertiesModal.propTypes = {
|
|
|
70
71
|
rejectLabel: PropTypes.string,
|
|
71
72
|
classNames: PropTypes.string
|
|
72
73
|
};
|
|
73
|
-
|
|
@@ -268,3 +268,9 @@ export const CARBON_BUTTON_SIZE = {
|
|
|
268
268
|
EXTRA_LARGE: "xl",
|
|
269
269
|
DEFAULT: "default" // TODO: remove this after upgrading to carbon 11.x
|
|
270
270
|
};
|
|
271
|
+
|
|
272
|
+
export const CONTAINER_TYPE = {
|
|
273
|
+
CUSTOM: "Custom",
|
|
274
|
+
TEARSHEET: "Tearsheet",
|
|
275
|
+
MODAL: "Modal"
|
|
276
|
+
};
|
|
@@ -434,7 +434,7 @@ export default class AbstractTable extends React.Component {
|
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
isLightTheme() {
|
|
437
|
-
return this.props.controller.getLight() && this.props.control.light
|
|
437
|
+
return this.props.controller.getLight() && this.props.control.light;
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
makeSelectedEditRow(selectedRows) {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import React from "react";
|
|
18
18
|
|
|
19
19
|
import { Type, ControlType } from "./../constants/form-constants";
|
|
20
|
-
import { STATES } from "./../constants/constants";
|
|
20
|
+
import { STATES, CONTAINER_TYPE } from "./../constants/constants";
|
|
21
21
|
import classNames from "classnames";
|
|
22
22
|
import { PropertyDef } from "./../form/PropertyDef";
|
|
23
23
|
import { makeControl } from "./../form/EditorForm";
|
|
@@ -360,9 +360,11 @@ export default class ControlFactory {
|
|
|
360
360
|
* Allows users to user a standard control in a custom control/panel
|
|
361
361
|
* @param paramDef - see parameter-def schema
|
|
362
362
|
* @param parameter - name of the parameter to pull from paramDef
|
|
363
|
+
* @param light - if this control is light themed
|
|
364
|
+
* @param containerType - the type of container common properties is rendering in
|
|
363
365
|
* @return control object (form schema) used to create standard react controls
|
|
364
366
|
*/
|
|
365
|
-
createFormControl(paramDef, parameter) {
|
|
367
|
+
createFormControl(paramDef, parameter, light = true, containerType = CONTAINER_TYPE.CUSTOM) {
|
|
366
368
|
if (!paramDef) {
|
|
367
369
|
return null;
|
|
368
370
|
}
|
|
@@ -374,7 +376,11 @@ export default class ControlFactory {
|
|
|
374
376
|
if (prop.propType() === Type.STRUCTURE && propDef.structureMetadata) {
|
|
375
377
|
structureDef = propDef.structureMetadata.getStructure(prop.baseType());
|
|
376
378
|
}
|
|
377
|
-
const
|
|
379
|
+
const additionalInfo = {
|
|
380
|
+
light: light,
|
|
381
|
+
containerType: containerType
|
|
382
|
+
};
|
|
383
|
+
const control = makeControl(propDef.parameterMetadata, parameter, null, structureDef, l10nProvider, null, null, null, additionalInfo);
|
|
378
384
|
return control;
|
|
379
385
|
}
|
|
380
386
|
return null;
|
|
@@ -329,7 +329,7 @@ class ExpressionControl extends React.Component {
|
|
|
329
329
|
applyLabel={applyLabel}
|
|
330
330
|
rejectLabel={rejectLabel}
|
|
331
331
|
title={expressonTitle}
|
|
332
|
-
light={this.props.controller.getLight()}
|
|
332
|
+
light={this.props.controller.getLight() && this.props.control.light}
|
|
333
333
|
>
|
|
334
334
|
<div>
|
|
335
335
|
<ExpressionBuilder
|
|
@@ -341,7 +341,7 @@ class ExpressionControl extends React.Component {
|
|
|
341
341
|
</WideFlyout>) : null;
|
|
342
342
|
|
|
343
343
|
const className = classNames(`properties-expression-editor ${messageType}`,
|
|
344
|
-
{ "properties-light-disabled": !this.props.control.light || !this.props.controller.getLight()
|
|
344
|
+
{ "properties-light-disabled": !this.props.control.light || !this.props.controller.getLight() });
|
|
345
345
|
|
|
346
346
|
const expressionLink = (<div className="properties-expression-link-container" >
|
|
347
347
|
{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() && this.props.control.light
|
|
153
|
+
light={this.props.controller.getLight() && this.props.control.light}
|
|
154
154
|
emptyTablePlaceholder={this.props.control.additionalText}
|
|
155
155
|
/>);
|
|
156
156
|
|
|
@@ -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() && this.props.control.light
|
|
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() && this.props.control.light
|
|
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} />
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
import { Control } from "./ControlInfo";
|
|
20
20
|
import { UIItem } from "./UIItem";
|
|
21
21
|
import { GroupType, PanelType, Type, ControlType, ParamRole, ORIENTATIONS } from "../constants/form-constants";
|
|
22
|
+
import { CONTAINER_TYPE } from "../constants/constants";
|
|
22
23
|
import logger from "../../../utils/logger";
|
|
23
24
|
import { StructureDef } from "./StructureInfo";
|
|
24
25
|
import { Action } from "./ActionInfo";
|
|
@@ -130,12 +131,17 @@ class NumberGenerator {
|
|
|
130
131
|
/**
|
|
131
132
|
* Creates tab based on parameter definition
|
|
132
133
|
*/
|
|
133
|
-
function makePrimaryTab(propertyDef, group, l10nProvider) {
|
|
134
|
+
function makePrimaryTab(propertyDef, group, l10nProvider, containerType) {
|
|
134
135
|
const label = l10nProvider.l10nLabel(group, group.name);
|
|
135
|
-
|
|
136
|
+
const additionalInfo = {
|
|
137
|
+
light: true,
|
|
138
|
+
containerType
|
|
139
|
+
};
|
|
140
|
+
return new EditorTab(label, group.name,
|
|
141
|
+
_makeUIItem(propertyDef.parameterMetadata, propertyDef.actionMetadata, group, propertyDef.structureMetadata, l10nProvider, additionalInfo));
|
|
136
142
|
}
|
|
137
143
|
|
|
138
|
-
function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider,
|
|
144
|
+
function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider, additionalInfo) {
|
|
139
145
|
const groupName = group.name;
|
|
140
146
|
let groupItem = null;
|
|
141
147
|
let groupLabel = null;
|
|
@@ -144,13 +150,13 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
|
|
|
144
150
|
switch (group.groupType()) {
|
|
145
151
|
case GroupType.CONTROLS:
|
|
146
152
|
return UIItem.makePanel(new ControlPanel(groupName, PanelType.GENERAL, groupClassName, nestedPanel,
|
|
147
|
-
_makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider,
|
|
153
|
+
_makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider, additionalInfo)));
|
|
148
154
|
case GroupType.COLUMN_SELECTION:
|
|
149
155
|
return UIItem.makePanel(new ControlPanel(groupName, PanelType.COLUMN_SELECTION, groupClassName, nestedPanel,
|
|
150
|
-
_makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider,
|
|
156
|
+
_makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider, additionalInfo)));
|
|
151
157
|
case GroupType.ADDITIONAL: {
|
|
152
158
|
const panel = new ControlPanel(groupName, PanelType.GENERAL, groupClassName, nestedPanel,
|
|
153
|
-
_makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider,
|
|
159
|
+
_makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider, additionalInfo));
|
|
154
160
|
groupLabel = l10nProvider.l10nLabel(group, group.name);
|
|
155
161
|
return UIItem.makeAdditionalLink(groupLabel, groupLabel, panel);
|
|
156
162
|
}
|
|
@@ -160,7 +166,7 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
|
|
|
160
166
|
if (Array.isArray(group.subGroups)) {
|
|
161
167
|
group.subGroups.forEach(function(subGroup) {
|
|
162
168
|
const subGroupName = subGroup.name;
|
|
163
|
-
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider,
|
|
169
|
+
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider, additionalInfo);
|
|
164
170
|
groupLabel = l10nProvider.l10nLabel(subGroup, subGroup.name);
|
|
165
171
|
subTabItems.push(new EditorTab(groupLabel, subGroupName, groupItem));
|
|
166
172
|
});
|
|
@@ -169,14 +175,14 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
|
|
|
169
175
|
}
|
|
170
176
|
case GroupType.PANEL_SELECTOR: {
|
|
171
177
|
// Defines a sub-tab group where each child group represents a sub-tab.
|
|
172
|
-
const panSelSubItems = _genPanelSelectorPanels(group, parameterMetadata, actionMetadata, structureMetadata, l10nProvider);
|
|
178
|
+
const panSelSubItems = _genPanelSelectorPanels(group, parameterMetadata, actionMetadata, structureMetadata, l10nProvider, additionalInfo);
|
|
173
179
|
return UIItem.makePanelSelector(groupName, panSelSubItems, group.dependsOn, groupClassName);
|
|
174
180
|
}
|
|
175
181
|
case GroupType.PANELS: {
|
|
176
182
|
const panSubItems = [];
|
|
177
183
|
if (Array.isArray(group.subGroups)) {
|
|
178
184
|
group.subGroups.forEach(function(subGroup) {
|
|
179
|
-
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider,
|
|
185
|
+
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider, additionalInfo);
|
|
180
186
|
panSubItems.push(groupItem);
|
|
181
187
|
});
|
|
182
188
|
}
|
|
@@ -186,7 +192,7 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
|
|
|
186
192
|
const panSubItems = [];
|
|
187
193
|
if (Array.isArray(group.subGroups)) {
|
|
188
194
|
group.subGroups.forEach(function(subGroup) {
|
|
189
|
-
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider,
|
|
195
|
+
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider, additionalInfo);
|
|
190
196
|
panSubItems.push(groupItem);
|
|
191
197
|
});
|
|
192
198
|
}
|
|
@@ -200,7 +206,7 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
|
|
|
200
206
|
const panSubItems = [];
|
|
201
207
|
if (Array.isArray(group.subGroups)) {
|
|
202
208
|
group.subGroups.forEach(function(subGroup) {
|
|
203
|
-
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider,
|
|
209
|
+
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider, additionalInfo);
|
|
204
210
|
panSubItems.push(groupItem);
|
|
205
211
|
});
|
|
206
212
|
}
|
|
@@ -232,7 +238,7 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
|
|
|
232
238
|
const panSubItems = [];
|
|
233
239
|
if (Array.isArray(group.subGroups)) {
|
|
234
240
|
group.subGroups.forEach(function(subGroup) {
|
|
235
|
-
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider,
|
|
241
|
+
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider, additionalInfo);
|
|
236
242
|
panSubItems.push(groupItem);
|
|
237
243
|
});
|
|
238
244
|
}
|
|
@@ -247,7 +253,8 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
|
|
|
247
253
|
const panSubItems = [];
|
|
248
254
|
if (Array.isArray(group.subGroups)) {
|
|
249
255
|
group.subGroups.forEach(function(subGroup) {
|
|
250
|
-
|
|
256
|
+
const additionalInfoUpdated = Object.assign({}, additionalInfo, { light: false });
|
|
257
|
+
groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider, additionalInfoUpdated);
|
|
251
258
|
panSubItems.push(groupItem);
|
|
252
259
|
});
|
|
253
260
|
}
|
|
@@ -262,7 +269,7 @@ function _makeUIItem(parameterMetadata, actionMetadata, group, structureMetadata
|
|
|
262
269
|
/**
|
|
263
270
|
* Called on a base property group.
|
|
264
271
|
*/
|
|
265
|
-
function _makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider,
|
|
272
|
+
function _makeControls(parameterMetadata, actionMetadata, group, structureMetadata, l10nProvider, additionalInfo) {
|
|
266
273
|
const uiItems = [];
|
|
267
274
|
const panelInsertedFor = [];
|
|
268
275
|
if (!Array.isArray(group.parameterNames())) {
|
|
@@ -276,7 +283,7 @@ function _makeControls(parameterMetadata, actionMetadata, group, structureMetada
|
|
|
276
283
|
structureDef = structureMetadata.getStructure(prop.baseType());
|
|
277
284
|
}
|
|
278
285
|
if (!(group instanceof StructureDef) || (group instanceof StructureDef && prop.isSubPanelEdit())) {
|
|
279
|
-
const ctrl = _makeControl(parameterMetadata, paramName, group, structureDef, l10nProvider, actionMetadata, structureMetadata, null,
|
|
286
|
+
const ctrl = _makeControl(parameterMetadata, paramName, group, structureDef, l10nProvider, actionMetadata, structureMetadata, null, additionalInfo);
|
|
280
287
|
const control = UIItem.makeControl(ctrl);
|
|
281
288
|
if (prop.separatorBefore()) {
|
|
282
289
|
uiItems.push(UIItem.makeHSeparator());
|
|
@@ -308,7 +315,7 @@ function _makeControls(parameterMetadata, actionMetadata, group, structureMetada
|
|
|
308
315
|
group.subGroups[i].dependsOn === control.control.name) {
|
|
309
316
|
panelInsertedFor.push(group.subGroups[i].dependsOn);
|
|
310
317
|
control.additionalItems =
|
|
311
|
-
_genPanelSelectorPanels(group.subGroups[i], parameterMetadata, actionMetadata, structureMetadata, l10nProvider);
|
|
318
|
+
_genPanelSelectorPanels(group.subGroups[i], parameterMetadata, actionMetadata, structureMetadata, l10nProvider, additionalInfo);
|
|
312
319
|
}
|
|
313
320
|
}
|
|
314
321
|
}
|
|
@@ -320,7 +327,7 @@ function _makeControls(parameterMetadata, actionMetadata, group, structureMetada
|
|
|
320
327
|
if (Array.isArray(group.subGroups)) {
|
|
321
328
|
group.subGroups.forEach(function(subGroup) {
|
|
322
329
|
if (!_hasPanelBeenInserted(panelInsertedFor, subGroup.dependsOn)) {
|
|
323
|
-
const uiItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider,
|
|
330
|
+
const uiItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider, additionalInfo);
|
|
324
331
|
uiItems.push(uiItem);
|
|
325
332
|
}
|
|
326
333
|
});
|
|
@@ -347,12 +354,12 @@ function _hasPanelBeenInserted(panelInsertedFor, dependsOn) {
|
|
|
347
354
|
* and its ID. The ID is subsequently used by the radioset control to decide
|
|
348
355
|
* which panel is displayed with which radio button.
|
|
349
356
|
*/
|
|
350
|
-
function _genPanelSelectorPanels(group, parameterMetadata, actionMetadata, structureMetadata, l10nProvider) {
|
|
357
|
+
function _genPanelSelectorPanels(group, parameterMetadata, actionMetadata, structureMetadata, l10nProvider, additionalInfo) {
|
|
351
358
|
const panSelSubItems = [];
|
|
352
359
|
if (Array.isArray(group.subGroups)) {
|
|
353
360
|
group.subGroups.forEach(function(subGroup) {
|
|
354
361
|
const subGroupName = subGroup.name;
|
|
355
|
-
const groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider);
|
|
362
|
+
const groupItem = _makeUIItem(parameterMetadata, actionMetadata, subGroup, structureMetadata, l10nProvider, additionalInfo);
|
|
356
363
|
const groupLabel = l10nProvider.l10nLabel(subGroup, subGroup.name);
|
|
357
364
|
panSelSubItems.push(new EditorTab(groupLabel, subGroupName, groupItem));
|
|
358
365
|
});
|
|
@@ -415,7 +422,7 @@ function _makeStringControl(parameter, isSubControl) {
|
|
|
415
422
|
/**
|
|
416
423
|
* Creates a control for the supplied property.
|
|
417
424
|
*/
|
|
418
|
-
function _makeControl(parameterMetadata, paramName, group, structureDefinition, l10nProvider, actionMetadata, structureMetadata, subControl,
|
|
425
|
+
function _makeControl(parameterMetadata, paramName, group, structureDefinition, l10nProvider, actionMetadata, structureMetadata, subControl, additionalInfo) {
|
|
419
426
|
const isSubControl = typeof subControl !== "undefined" && subControl;
|
|
420
427
|
|
|
421
428
|
// Assume the property is defined
|
|
@@ -505,7 +512,7 @@ function _makeControl(parameterMetadata, paramName, group, structureDefinition,
|
|
|
505
512
|
|
|
506
513
|
if (structureDef) {
|
|
507
514
|
if (structureDef.hasSubPanel()) {
|
|
508
|
-
childItem = _makeEditStyleSubPanel(structureDef, l10nProvider, structureMetadata);
|
|
515
|
+
childItem = _makeEditStyleSubPanel(structureDef, l10nProvider, structureMetadata, additionalInfo);
|
|
509
516
|
}
|
|
510
517
|
keyIndex = structureDef.keyAttributeIndex();
|
|
511
518
|
// The defaultRow allows the UI to create a new row with sensible settings
|
|
@@ -515,14 +522,14 @@ function _makeControl(parameterMetadata, paramName, group, structureDefinition,
|
|
|
515
522
|
subControls = [];
|
|
516
523
|
if (structureDef.parameterMetadata && Array.isArray(structureDef.parameterMetadata.paramDefs)) {
|
|
517
524
|
structureDef.parameterMetadata.paramDefs.forEach(function(param) {
|
|
518
|
-
const newSubControl = _makeSubControl(param, l10nProvider, structureMetadata);
|
|
525
|
+
const newSubControl = _makeSubControl(param, l10nProvider, structureMetadata, additionalInfo);
|
|
519
526
|
subControls.push(newSubControl);
|
|
520
527
|
});
|
|
521
528
|
}
|
|
522
529
|
// If the property is a keyed property or a structure list then the key should not be included in the
|
|
523
530
|
// structure definition. However it will still need to be included in the table column definitions.
|
|
524
531
|
if ((parameter.isMapValue() || parameter.isList()) && structureDef.keyDefinition) {
|
|
525
|
-
const newSubControl = _makeSubControl(structureDef.keyDefinition, l10nProvider, structureMetadata);
|
|
532
|
+
const newSubControl = _makeSubControl(structureDef.keyDefinition, l10nProvider, structureMetadata, additionalInfo);
|
|
526
533
|
subControls.unshift(newSubControl);
|
|
527
534
|
}
|
|
528
535
|
if (parameter.isList() || parameter.isMapValue()) {
|
|
@@ -643,7 +650,7 @@ function _makeControl(parameterMetadata, paramName, group, structureDefinition,
|
|
|
643
650
|
settings.customValueAllowed = parameter.customValueAllowed;
|
|
644
651
|
settings.className = parameter.className;
|
|
645
652
|
settings.buttons = buttons;
|
|
646
|
-
settings.light = light;
|
|
653
|
+
settings.light = _isControlLight(additionalInfo.light, additionalInfo.containerType, parameter.isSubPanelEdit());
|
|
647
654
|
if (isSubControl) {
|
|
648
655
|
settings.visible = parameter.visible;
|
|
649
656
|
settings.width = parameter.columns(8);
|
|
@@ -654,6 +661,12 @@ function _makeControl(parameterMetadata, paramName, group, structureDefinition,
|
|
|
654
661
|
return new Control(settings);
|
|
655
662
|
}
|
|
656
663
|
|
|
664
|
+
function _isControlLight(light, containerType, isSubPanelEdit) {
|
|
665
|
+
return light &&
|
|
666
|
+
(containerType !== CONTAINER_TYPE.TEARSHEET || // Controls displayed in a Tearsheet are not light themed
|
|
667
|
+
(containerType === CONTAINER_TYPE.TEARSHEET && isSubPanelEdit)); // Controls inside a subpanel of tearsheet container are light themed
|
|
668
|
+
}
|
|
669
|
+
|
|
657
670
|
function _processListParameter(parameter) {
|
|
658
671
|
const controlObj = {};
|
|
659
672
|
switch (parameter.getRole()) {
|
|
@@ -677,7 +690,7 @@ function _processListParameter(parameter) {
|
|
|
677
690
|
return controlObj;
|
|
678
691
|
}
|
|
679
692
|
|
|
680
|
-
function _makeEditStyleSubPanel(structureDef, l10nProvider, structureMetadata) {
|
|
693
|
+
function _makeEditStyleSubPanel(structureDef, l10nProvider, structureMetadata, additionalInfo) {
|
|
681
694
|
// If we"re not editing in-line then create a sub-panel that can be used to edit the attributes
|
|
682
695
|
const panel = new ControlPanel(
|
|
683
696
|
structureDef.name,
|
|
@@ -688,7 +701,8 @@ function _makeEditStyleSubPanel(structureDef, l10nProvider, structureMetadata) {
|
|
|
688
701
|
structureDef.actionMetadata,
|
|
689
702
|
structureDef,
|
|
690
703
|
structureMetadata,
|
|
691
|
-
l10nProvider
|
|
704
|
+
l10nProvider,
|
|
705
|
+
additionalInfo)
|
|
692
706
|
);
|
|
693
707
|
const groupLabel = l10nProvider.l10nLabel(structureDef, structureDef.name);
|
|
694
708
|
return UIItem.makeAdditionalLink("...", groupLabel, panel);
|
|
@@ -697,14 +711,14 @@ function _makeEditStyleSubPanel(structureDef, l10nProvider, structureMetadata) {
|
|
|
697
711
|
/**
|
|
698
712
|
* Creates a column control for the supplied property/attribute.
|
|
699
713
|
*/
|
|
700
|
-
function _makeSubControl(parameter, l10nProvider, structureMetadata) {
|
|
714
|
+
function _makeSubControl(parameter, l10nProvider, structureMetadata, additionalInfo) {
|
|
701
715
|
const parameterMetadata = null;
|
|
702
716
|
const paramName = null;
|
|
703
717
|
const group = null;
|
|
704
718
|
const structureDef = parameter.propType() === Type.STRUCTURE ? structureMetadata.getStructure(parameter.baseType()) : null;
|
|
705
719
|
const actionMetadata = null;
|
|
706
720
|
const subControl = parameter;
|
|
707
|
-
return _makeControl(parameterMetadata, paramName, group, structureDef, l10nProvider, actionMetadata, structureMetadata, subControl);
|
|
721
|
+
return _makeControl(parameterMetadata, paramName, group, structureDef, l10nProvider, actionMetadata, structureMetadata, subControl, additionalInfo);
|
|
708
722
|
}
|
|
709
723
|
|
|
710
724
|
/**
|
|
@@ -21,6 +21,7 @@ import { UIItem } from "./UIItem";
|
|
|
21
21
|
import { L10nProvider } from "../util/L10nProvider";
|
|
22
22
|
import { translateMessages } from "./Conditions";
|
|
23
23
|
import { Size } from "../constants/form-constants";
|
|
24
|
+
import { CONTAINER_TYPE } from "../constants/constants";
|
|
24
25
|
|
|
25
26
|
export default class Form {
|
|
26
27
|
constructor(componentId, label, labelEditable, help, editorSize, pixelWidth, uiItems, buttons, data, conditions, resources, icon, heading) {
|
|
@@ -42,9 +43,9 @@ export default class Form {
|
|
|
42
43
|
/**
|
|
43
44
|
* Returns a new Form
|
|
44
45
|
* @param paramDef Parameter definition
|
|
45
|
-
* @param
|
|
46
|
+
* @param containerType Type of container common properties will be displayed in, set in propertiesConfig
|
|
46
47
|
*/
|
|
47
|
-
static makeForm(paramDef,
|
|
48
|
+
static makeForm(paramDef, containerType) {
|
|
48
49
|
const propDef = PropertyDef.makePropertyDef(propertyOf(paramDef)("titleDefinition"), propertyOf(paramDef)("parameters"), propertyOf(paramDef)("complex_types"),
|
|
49
50
|
propertyOf(paramDef)("uihints"));
|
|
50
51
|
const resources = propertyOf(paramDef)("resources");
|
|
@@ -54,7 +55,7 @@ export default class Form {
|
|
|
54
55
|
const tabs = [];
|
|
55
56
|
if (propDef.groupMetadata && propDef.groupMetadata.groups) {
|
|
56
57
|
for (const group of propDef.groupMetadata.groups) {
|
|
57
|
-
tabs.push(makePrimaryTab(propDef, group, l10nProvider,
|
|
58
|
+
tabs.push(makePrimaryTab(propDef, group, l10nProvider, containerType));
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
|
|
@@ -63,6 +64,7 @@ export default class Form {
|
|
|
63
64
|
uiCurrentParameters: propertyOf(paramDef)("current_ui_parameters"),
|
|
64
65
|
datasetMetadata: propertyOf(paramDef)("dataset_metadata")
|
|
65
66
|
};
|
|
67
|
+
const isModal = containerType === CONTAINER_TYPE.TEARSHEET || containerType === CONTAINER_TYPE.MODAL;
|
|
66
68
|
const editorSizeDefault = isModal ? Size.LARGE : Size.SMALL;
|
|
67
69
|
return new Form(propDef.name,
|
|
68
70
|
propDef.label,
|
|
@@ -44,7 +44,7 @@ class TearSheet extends Component {
|
|
|
44
44
|
return (
|
|
45
45
|
<Portal>
|
|
46
46
|
<ComposedModal
|
|
47
|
-
className="properties-tearsheet-panel"
|
|
47
|
+
className={classNames("properties-tearsheet-panel", { "properties-tearsheet-stacked": this.props.stacked })}
|
|
48
48
|
open={this.props.open}
|
|
49
49
|
size="lg"
|
|
50
50
|
preventCloseOnClickOutside
|
|
@@ -72,6 +72,7 @@ class TearSheet extends Component {
|
|
|
72
72
|
}
|
|
73
73
|
TearSheet.propTypes = {
|
|
74
74
|
open: PropTypes.bool,
|
|
75
|
+
stacked: PropTypes.bool,
|
|
75
76
|
onCloseCallback: PropTypes.func,
|
|
76
77
|
tearsheet: PropTypes.shape({
|
|
77
78
|
title: PropTypes.string.isRequired,
|
|
@@ -92,7 +93,8 @@ TearSheet.propTypes = {
|
|
|
92
93
|
TearSheet.defaultProps = {
|
|
93
94
|
open: false,
|
|
94
95
|
showPropertiesButtons: false,
|
|
95
|
-
applyOnBlur: false
|
|
96
|
+
applyOnBlur: false,
|
|
97
|
+
stacked: false
|
|
96
98
|
};
|
|
97
99
|
|
|
98
100
|
export default TearSheet;
|
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
$properties-buttons-height: $spacing-10;
|
|
18
18
|
|
|
19
|
+
.properties-tearsheet-panel.properties-tearsheet-stacked.bx--modal {
|
|
20
|
+
.bx--modal-container {
|
|
21
|
+
max-height: calc(100% - 104px);
|
|
22
|
+
width: calc(100% - 96px);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
19
26
|
.properties-tearsheet-panel.bx--modal {
|
|
20
27
|
align-items: flex-end;
|
|
21
28
|
&.is-visible {
|
|
@@ -131,8 +131,8 @@ export default class PropertiesController {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
setParamDef(paramDef) {
|
|
134
|
-
const
|
|
135
|
-
const formData = Form.makeForm(paramDef,
|
|
134
|
+
const containerType = get(this.getPropertiesConfig(), "containerType");
|
|
135
|
+
const formData = Form.makeForm(paramDef, containerType);
|
|
136
136
|
this.setForm(formData);
|
|
137
137
|
}
|
|
138
138
|
|
|
@@ -1754,7 +1754,8 @@ export default class PropertiesController {
|
|
|
1754
1754
|
* @param parameter (string) - name of the parameter to pull out of paramDef
|
|
1755
1755
|
*/
|
|
1756
1756
|
createControl(propertyId, paramDef, parameter) {
|
|
1757
|
-
const
|
|
1757
|
+
const containerType = get(this.getPropertiesConfig(), "containerType");
|
|
1758
|
+
const control = this.controlFactory.createFormControl(paramDef, parameter, this.getLight(), containerType);
|
|
1758
1759
|
const controls = [];
|
|
1759
1760
|
// need to preserve parentCategoryId which is set during initial parsing of all controls
|
|
1760
1761
|
const parentCategoryId = this.getControl(propertyId).parentCategoryId;
|
|
@@ -17,11 +17,13 @@
|
|
|
17
17
|
$common-properties-small-flyout-width: 320px; // This aligns the right-flyout with the divider in DSX header
|
|
18
18
|
$common-properties-medium-flyout-width: 480px; // This is an arbitrary width for medium sized flyout panels
|
|
19
19
|
$common-properties-large-flyout-width: 640px; // This is an arbitrary width for large sized flyout panels
|
|
20
|
+
$common-properties-max-flyout-width: 900px; // This is an arbitrary width for max sized flyout panels
|
|
20
21
|
|
|
21
22
|
// sass-lint:disable no-misspelled-properties
|
|
22
23
|
:export {
|
|
23
24
|
flyoutWidthSmall: $common-properties-small-flyout-width;
|
|
24
25
|
flyoutWidthMedium: $common-properties-medium-flyout-width;
|
|
25
26
|
flyoutWidthLarge: $common-properties-large-flyout-width;
|
|
27
|
+
flyoutWidthMax: $common-properties-max-flyout-width;
|
|
26
28
|
}
|
|
27
29
|
// sass-lint:enable no-misspelled-properties
|