@elyra/canvas 13.0.0-alpha.1 → 13.0.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/build.sh +6 -2
- package/dist/{canvas-controller-488d8e7b.js → canvas-controller-13afbf7b.js} +2 -2
- package/dist/{canvas-controller-866bf117.js.map → canvas-controller-13afbf7b.js.map} +1 -1
- package/dist/{canvas-controller-866bf117.js → canvas-controller-bf9c0dd2.js} +2 -2
- package/dist/{canvas-controller-488d8e7b.js.map → canvas-controller-bf9c0dd2.js.map} +1 -1
- package/dist/common-canvas-bbc57d20.js +2 -0
- package/dist/common-canvas-bbc57d20.js.map +1 -0
- package/dist/common-canvas-ef71be09.js +2 -0
- package/dist/common-canvas-ef71be09.js.map +1 -0
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/common-properties-ddfc6e24.js +2 -0
- package/dist/common-properties-ddfc6e24.js.map +1 -0
- package/dist/common-properties-e64e7304.js +2 -0
- package/dist/common-properties-e64e7304.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/command-stack.es.js +1 -1
- package/dist/lib/command-stack.es.js.map +1 -1
- package/dist/lib/command-stack.js +1 -1
- package/dist/lib/command-stack.js.map +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-35db2f4c.js → toolbar-5417d781.js} +2 -2
- package/dist/{toolbar-35db2f4c.js.map → toolbar-5417d781.js.map} +1 -1
- package/dist/{toolbar-9b99500d.js → toolbar-bcb3055d.js} +2 -2
- package/dist/{toolbar-9b99500d.js.map → toolbar-bcb3055d.js.map} +1 -1
- package/package.json +1 -1
- package/src/command-stack/command-stack.js +4 -0
- package/src/common-canvas/canvas-controller.js +14 -6
- package/src/common-canvas/cc-context-toolbar.jsx +10 -3
- package/src/common-canvas/cc-toolbar.jsx +0 -3
- package/src/common-canvas/common-canvas.scss +0 -6
- package/src/common-canvas/svg-canvas-renderer.js +10 -2
- package/src/common-canvas/svg-canvas-utils-external.js +21 -10
- package/src/common-properties/components/editor-form/editor-form.jsx +33 -14
- package/src/common-properties/components/editor-form/editor-form.scss +42 -43
- package/src/common-properties/controls/control-factory.js +9 -2
- package/src/common-properties/controls/datefield/datefield.jsx +12 -14
- package/src/common-properties/controls/datepicker/datepicker.jsx +21 -23
- package/src/common-properties/controls/datepicker-range/datepicker-range.jsx +33 -35
- package/src/common-properties/controls/dropdown/dropdown.jsx +37 -43
- package/src/common-properties/controls/dropdown/dropdown.scss +1 -1
- package/src/common-properties/controls/multiselect/multiselect.jsx +23 -27
- package/src/common-properties/controls/numberfield/numberfield.jsx +16 -18
- package/src/common-properties/controls/passwordfield/passwordfield.jsx +15 -17
- package/src/common-properties/controls/radioset/radioset.jsx +11 -8
- package/src/common-properties/controls/radioset/radioset.scss +6 -14
- package/src/common-properties/controls/slider/slider.jsx +16 -18
- package/src/common-properties/controls/textarea/textarea.jsx +20 -24
- package/src/common-properties/controls/textfield/textfield.jsx +13 -15
- package/src/common-properties/controls/timefield/timefield.jsx +12 -14
- package/src/common-properties/form/ControlInfo.js +1 -1
- package/src/common-properties/panels/subtabs/subtabs.scss +4 -4
- package/src/toolbar/toolbar-action-item.jsx +38 -4
- package/src/toolbar/toolbar-button-item.jsx +38 -28
- package/src/toolbar/toolbar-overflow-item.jsx +27 -10
- package/src/toolbar/toolbar.jsx +22 -22
- package/src/toolbar/toolbar.scss +61 -11
- package/stats.html +1 -1
- package/dist/common-canvas-3ffaf6ca.js +0 -2
- package/dist/common-canvas-3ffaf6ca.js.map +0 -1
- package/dist/common-canvas-c1a57382.js +0 -2
- package/dist/common-canvas-c1a57382.js.map +0 -1
- package/dist/common-properties-3cce68e0.js +0 -2
- package/dist/common-properties-3cce68e0.js.map +0 -1
- package/dist/common-properties-5cac340d.js +0 -2
- package/dist/common-properties-5cac340d.js.map +0 -1
package/package.json
CHANGED
|
@@ -51,6 +51,10 @@ export default class CommandStack {
|
|
|
51
51
|
return this.commands.getUndoCommands().toArray();
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
getAllRedoCommands() {
|
|
55
|
+
return this.commands.getRedoCommands().toArray();
|
|
56
|
+
}
|
|
57
|
+
|
|
54
58
|
// need this for validation on unit tests
|
|
55
59
|
getStack() {
|
|
56
60
|
return {
|
|
@@ -128,12 +128,14 @@ export default class CanvasController {
|
|
|
128
128
|
|
|
129
129
|
setCanvasConfig(config) {
|
|
130
130
|
this.logger.log("Setting Canvas Config");
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
if (config) {
|
|
132
|
+
// TODO - Remove these next three lines in next major release.
|
|
133
|
+
const correctConfig = this.correctTypo(config);
|
|
134
|
+
correctConfig.enableNodeLayout =
|
|
135
|
+
CanvasUtils.convertPortPosInfo(correctConfig.enableNodeLayout);
|
|
136
|
+
this.objectModel.openPaletteIfNecessary(config);
|
|
137
|
+
this.objectModel.setCanvasConfig(correctConfig);
|
|
138
|
+
}
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
// Converts the config option 'enableHightlightNodeOnNewLinkDrag' (which has
|
|
@@ -1432,6 +1434,12 @@ export default class CanvasController {
|
|
|
1432
1434
|
return this.getCommandStack().getAllUndoCommands();
|
|
1433
1435
|
}
|
|
1434
1436
|
|
|
1437
|
+
// Returns an array of all redoable commands currently on the
|
|
1438
|
+
// command stack.
|
|
1439
|
+
getAllRedoCommands() {
|
|
1440
|
+
return this.getCommandStack().getAllRedoCommands();
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1435
1443
|
// Returns a string which is the label that descibes the next undoable
|
|
1436
1444
|
// command.
|
|
1437
1445
|
getUndoLabel() {
|
|
@@ -25,6 +25,7 @@ import ColorPicker from "../color-picker";
|
|
|
25
25
|
const CM_TOOLBAR_GAP = 2;
|
|
26
26
|
const CM_ICON_SIZE = 32;
|
|
27
27
|
const CM_ICON_PAD = 2;
|
|
28
|
+
const DIVIDER_SIZE = 1;
|
|
28
29
|
const ICON_SIZE_PLUS_GAP = CM_ICON_SIZE + CM_TOOLBAR_GAP;
|
|
29
30
|
const PADDING = 2;
|
|
30
31
|
|
|
@@ -104,17 +105,22 @@ class CommonCanvasContextToolbar extends React.Component {
|
|
|
104
105
|
|
|
105
106
|
// Returns the width of the context toolbar.
|
|
106
107
|
getContextToolbarWidth(toolbarItems, overflowMenuItems) {
|
|
108
|
+
const dividers = toolbarItems.filter((i) => i.divider);
|
|
109
|
+
const dividersCount = dividers.length;
|
|
110
|
+
const dividersWidth = dividersCount * DIVIDER_SIZE;
|
|
111
|
+
|
|
107
112
|
// If there is at least one overflow item, we will need an overflow
|
|
108
113
|
// icon which will increase the toolbar items by one.
|
|
109
114
|
const overflowItemCount = overflowMenuItems.length > 0 ? 1 : 0;
|
|
110
|
-
const
|
|
115
|
+
const buttonsCount = toolbarItems.length + overflowItemCount - dividersCount;
|
|
116
|
+
const buttonsWidth = (buttonsCount * (CM_ICON_SIZE + CM_ICON_PAD));
|
|
111
117
|
|
|
112
118
|
// If we have some overflow menu items, we reduce the width by five pixels
|
|
113
119
|
// which forces the overflow menu and the overflow icon to be shown. We
|
|
114
120
|
// use 5 pixels because this is how many are needed to make the toolbar
|
|
115
121
|
// work correcty with differnet browser magnificaitons.
|
|
116
122
|
const reduction = overflowMenuItems.length > 0 ? 5 : 0;
|
|
117
|
-
return
|
|
123
|
+
return buttonsWidth + dividersWidth - reduction;
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
// Removes leading and trailing dividers from the items array and any
|
|
@@ -210,7 +216,7 @@ class CommonCanvasContextToolbar extends React.Component {
|
|
|
210
216
|
let contextToolbar = null;
|
|
211
217
|
|
|
212
218
|
if (this.props.showContextMenu) {
|
|
213
|
-
const toolbarItems = this.props.contextMenuDef.filter((cmItem) => cmItem.toolbarItem
|
|
219
|
+
const toolbarItems = this.props.contextMenuDef.filter((cmItem) => cmItem.toolbarItem);
|
|
214
220
|
let overflowMenuItems = this.props.contextMenuDef.filter((cmItem) => !cmItem.toolbarItem);
|
|
215
221
|
overflowMenuItems = this.removeUnnecessaryDividers(overflowMenuItems);
|
|
216
222
|
const toolbarConfig = this.getToolbarConfig({ toolbarItems, overflowMenuItems });
|
|
@@ -224,6 +230,7 @@ class CommonCanvasContextToolbar extends React.Component {
|
|
|
224
230
|
: pos.x - toolbarWidth;
|
|
225
231
|
let y = pos.y - ICON_SIZE_PLUS_GAP;
|
|
226
232
|
|
|
233
|
+
// Make sure the context toolbar is fully inside the viewport.
|
|
227
234
|
({ x, y } = this.adjustPosToFit(x, y, toolbarWidth, ICON_SIZE_PLUS_GAP));
|
|
228
235
|
|
|
229
236
|
contextToolbar = (
|
|
@@ -223,7 +223,6 @@ class CommonCanvasToolbar extends React.Component {
|
|
|
223
223
|
|
|
224
224
|
if (typeof toolbarConfig !== "undefined") {
|
|
225
225
|
const editingAllowed = this.props.enableEditingActions;
|
|
226
|
-
this.applyToolState("multiUndo", toolbarConfig, editingAllowed && this.props.canMultiUndo);
|
|
227
226
|
this.applyToolState("undo", toolbarConfig, editingAllowed && this.props.canUndo);
|
|
228
227
|
this.applyToolState("redo", toolbarConfig, editingAllowed && this.props.canRedo);
|
|
229
228
|
this.applyToolState("cut", toolbarConfig, editingAllowed && this.props.canCutCopy);
|
|
@@ -327,7 +326,6 @@ CommonCanvasToolbar.propTypes = {
|
|
|
327
326
|
notificationConfigKeepOpen: PropTypes.bool,
|
|
328
327
|
enableInternalObjectModel: PropTypes.bool,
|
|
329
328
|
enableEditingActions: PropTypes.bool,
|
|
330
|
-
canMultiUndo: PropTypes.bool,
|
|
331
329
|
canUndo: PropTypes.bool,
|
|
332
330
|
canRedo: PropTypes.bool,
|
|
333
331
|
canCutCopy: PropTypes.bool,
|
|
@@ -353,7 +351,6 @@ const mapStateToProps = (state, ownProps) => ({
|
|
|
353
351
|
notificationMessages: state.notifications,
|
|
354
352
|
enableInternalObjectModel: state.canvasconfig.enableInternalObjectModel,
|
|
355
353
|
enableEditingActions: state.canvasconfig.enableEditingActions,
|
|
356
|
-
canMultiUndo: ownProps.canvasController.getAllUndoCommands().length > 1,
|
|
357
354
|
canUndo: ownProps.canvasController.canUndo(),
|
|
358
355
|
canRedo: ownProps.canvasController.canRedo(),
|
|
359
356
|
canCutCopy: ownProps.canvasController.canCutCopy(),
|
|
@@ -120,12 +120,6 @@ $panel-border-color: $border-subtle-01;
|
|
|
120
120
|
border-color: transparent;
|
|
121
121
|
box-shadow: inset 2px 2px $button-tertiary, inset -6px -2px $button-tertiary;
|
|
122
122
|
}
|
|
123
|
-
// Set padding so overflow icon appears in the center (horizontally). This
|
|
124
|
-
// offsets the 5px which are set in the code to make the overflow icon
|
|
125
|
-
// be generated correctly.
|
|
126
|
-
.toolbar-item-content {
|
|
127
|
-
padding-left: 4px;
|
|
128
|
-
}
|
|
129
123
|
}
|
|
130
124
|
}
|
|
131
125
|
|
|
@@ -24,7 +24,7 @@ import * as d3Fetch from "d3-fetch";
|
|
|
24
24
|
const d3 = Object.assign({}, d3Selection, d3Fetch);
|
|
25
25
|
|
|
26
26
|
const markdownIt = require("markdown-it")({
|
|
27
|
-
html:
|
|
27
|
+
html: true, // Allow HTML to be executed in comments.
|
|
28
28
|
linkify: false, // Don't convert strings, in URL format, to be links.
|
|
29
29
|
typographer: true
|
|
30
30
|
});
|
|
@@ -1765,7 +1765,15 @@ export default class SVGCanvasRenderer {
|
|
|
1765
1765
|
}
|
|
1766
1766
|
|
|
1767
1767
|
removeNodes(removeSel) {
|
|
1768
|
-
// Remove any
|
|
1768
|
+
// Remove any JSX decorations for the nodes being removed to
|
|
1769
|
+
// unmount their React objects.
|
|
1770
|
+
removeSel
|
|
1771
|
+
.selectAll(".d3-foreign-object-dec-jsx")
|
|
1772
|
+
.each((d, idx, exts) =>
|
|
1773
|
+
this.externalUtils.removeExternalObject(d, idx, exts));
|
|
1774
|
+
|
|
1775
|
+
// Remove any foreign objects for React nodes to
|
|
1776
|
+
// unmount their React objects.
|
|
1769
1777
|
removeSel
|
|
1770
1778
|
.selectChildren(".d3-foreign-object-external-node")
|
|
1771
1779
|
.each((d, idx, exts) =>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2023 Elyra Authors
|
|
2
|
+
* Copyright 2023-2024 Elyra Authors
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -25,28 +25,39 @@ export default class SvgCanvasExternal {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
addNodeExternalObject(node, i, foreignObjects) {
|
|
28
|
-
const
|
|
29
|
-
const root = createRoot(container);
|
|
30
|
-
|
|
31
|
-
root.render(
|
|
28
|
+
const jsx = (
|
|
32
29
|
<node.layout.nodeExternalObject
|
|
33
30
|
nodeData={node}
|
|
34
31
|
canvasController={this.ren.canvasController}
|
|
35
32
|
externalUtils={this}
|
|
36
33
|
/>
|
|
37
34
|
);
|
|
35
|
+
this.renderExternalObject(jsx, foreignObjects[i]);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
addDecExternalObject(dec, i, foreignObjects) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
this.renderExternalObject(dec.jsx, foreignObjects[i]);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
renderExternalObject(jsx, container) {
|
|
43
|
+
if (!container.root) {
|
|
44
|
+
container.root = createRoot(container);
|
|
45
|
+
}
|
|
46
|
+
container.root.render(jsx);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
removeExternalObject(obj, i, foreignObjects) {
|
|
47
50
|
const container = foreignObjects[i];
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
if (!container.root) {
|
|
52
|
+
container.root = createRoot(container);
|
|
53
|
+
}
|
|
54
|
+
// Unmount in Timeout to stop this warning from appearing:
|
|
55
|
+
// "Warning: Attempted to synchronously unmount a root while
|
|
56
|
+
// React was already rendering."
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
container.root.unmount();
|
|
59
|
+
container.root = null;
|
|
60
|
+
});
|
|
50
61
|
}
|
|
51
62
|
|
|
52
63
|
getActiveNodes() {
|
|
@@ -18,7 +18,7 @@ import React from "react";
|
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
19
|
import { connect } from "react-redux";
|
|
20
20
|
import { setActiveTab } from "./../../actions";
|
|
21
|
-
import { Tab, Tabs, TabList, TabPanel, Link, TabPanels } from "@carbon/react";
|
|
21
|
+
import { Tab, Tabs, TabList, TabPanel, Link, TabPanels, Accordion, AccordionItem } from "@carbon/react";
|
|
22
22
|
import * as PropertyUtil from "./../../util/property-utils";
|
|
23
23
|
import { MESSAGE_KEYS, CARBON_ICONS, CONDITION_MESSAGE_TYPE, STATES, CATEGORY_VIEW } from "./../../constants/constants";
|
|
24
24
|
import { cloneDeep, isEmpty, sortBy, get, filter } from "lodash";
|
|
@@ -73,9 +73,12 @@ class EditorForm extends React.Component {
|
|
|
73
73
|
this.FIRST_TEARSHEET_ID = null;
|
|
74
74
|
this.TEARSHEETS = {};
|
|
75
75
|
this.visibleTearsheet = null;
|
|
76
|
+
this.defaultOpenTab = props.activeTab;
|
|
77
|
+
this.alertOpenTab = null;
|
|
76
78
|
|
|
77
79
|
}
|
|
78
80
|
|
|
81
|
+
|
|
79
82
|
shouldComponentUpdate(nextProps, nextState) {
|
|
80
83
|
if (!this.props.controller.isSummaryPanelShowing() && !this.props.controller.isSubPanelsShowing()) {
|
|
81
84
|
// only update list of error messages when no summary panel or sub-panel is shown,
|
|
@@ -120,11 +123,21 @@ class EditorForm extends React.Component {
|
|
|
120
123
|
if (this.props.activeTab === panelId) {
|
|
121
124
|
activeTab = "";
|
|
122
125
|
}
|
|
126
|
+
if (this.alertOpenTab === panelId) {
|
|
127
|
+
this.alertOpenTab = null;
|
|
128
|
+
}
|
|
129
|
+
if (this.defaultOpenTab === panelId) {
|
|
130
|
+
this.defaultOpenTab = null;
|
|
131
|
+
}
|
|
123
132
|
this.props.setActiveTab(activeTab);
|
|
124
133
|
}
|
|
125
134
|
|
|
126
135
|
_handleMessageClick(controlId, ev) {
|
|
127
136
|
const control = this.props.controller.getControl(controlId);
|
|
137
|
+
this.alertOpenTab = control.parentCategoryId;
|
|
138
|
+
if (this.defaultOpenTab === this.alertOpenTab) {
|
|
139
|
+
this.defaultOpenTab = null;
|
|
140
|
+
}
|
|
128
141
|
this.props.setActiveTab(control.parentCategoryId);
|
|
129
142
|
}
|
|
130
143
|
|
|
@@ -134,6 +147,7 @@ class EditorForm extends React.Component {
|
|
|
134
147
|
|
|
135
148
|
genPrimaryTabs(key, tabs, propertyId, indexof) {
|
|
136
149
|
const tabContent = [];
|
|
150
|
+
const tabContentAcc = [];
|
|
137
151
|
const tabLists = [];
|
|
138
152
|
const tabPanels = [];
|
|
139
153
|
let hasAlertsTab = false;
|
|
@@ -170,10 +184,8 @@ class EditorForm extends React.Component {
|
|
|
170
184
|
);
|
|
171
185
|
}
|
|
172
186
|
if (this.props.rightFlyout && this.props.categoryView !== CATEGORY_VIEW.TABS) {
|
|
173
|
-
let panelArrow = <Icon type={CARBON_ICONS.CHEVRONARROWS.DOWN} className="properties-category-caret-down" />;
|
|
174
187
|
let categoryOpen = false;
|
|
175
188
|
if (this.props.activeTab === tab.group) {
|
|
176
|
-
panelArrow = <Icon type={CARBON_ICONS.CHEVRONARROWS.UP} className="properties-category-caret-up" />;
|
|
177
189
|
categoryOpen = true;
|
|
178
190
|
}
|
|
179
191
|
if (tab.content.itemType !== ItemType.TEARSHEET && nonTearsheetTabs.length === 1) {
|
|
@@ -184,20 +196,20 @@ class EditorForm extends React.Component {
|
|
|
184
196
|
</div>
|
|
185
197
|
);
|
|
186
198
|
} else {
|
|
187
|
-
|
|
199
|
+
tabContentAcc.push(
|
|
188
200
|
<div key={this._getContainerIndex(hasAlertsTab, i) + "-" + key}
|
|
189
201
|
className={classNames("properties-category-container", { "properties-hidden-container": tab.content.itemType === ItemType.TEARSHEET })}
|
|
190
202
|
>
|
|
191
|
-
<
|
|
192
|
-
|
|
203
|
+
<AccordionItem title={`${tab.text}${this._getMessageCountForCategory(tab) ? this._getMessageCountForCategory(tab) : ""}`}
|
|
204
|
+
// Open Tab with Alert Message when from Alerts Tab or a open Default Tab
|
|
205
|
+
open={ this.defaultOpenTab === tab.group || this.alertOpenTab === tab.group }
|
|
206
|
+
onHeadingClick={this._showCategoryPanel.bind(this, tab.group)}
|
|
207
|
+
className={`${classNames("properties-category-content",
|
|
208
|
+
{ "show": categoryOpen })}`}
|
|
193
209
|
>
|
|
194
|
-
{tab.text}{this._getMessageCountForCategory(tab)}
|
|
195
|
-
{panelArrow}
|
|
196
|
-
</button>
|
|
197
|
-
<div className={classNames("properties-category-content", { "show": categoryOpen }) }>
|
|
198
210
|
{panelItems}
|
|
199
211
|
{additionalComponent}
|
|
200
|
-
</
|
|
212
|
+
</AccordionItem>
|
|
201
213
|
</div>
|
|
202
214
|
);
|
|
203
215
|
}
|
|
@@ -230,9 +242,16 @@ class EditorForm extends React.Component {
|
|
|
230
242
|
|
|
231
243
|
if (this.props.rightFlyout && this.props.categoryView !== CATEGORY_VIEW.TABS) {
|
|
232
244
|
return (
|
|
233
|
-
|
|
234
|
-
{tabContent}
|
|
235
|
-
|
|
245
|
+
<>
|
|
246
|
+
{tabContent.length ? (<div key={"cat." + key} className="properties-categories">
|
|
247
|
+
{tabContent}
|
|
248
|
+
</div>) : null}
|
|
249
|
+
{tabContentAcc.length ? (<Accordion size="lg">
|
|
250
|
+
<div key={"cat." + key} className="properties-categories">
|
|
251
|
+
{tabContentAcc}
|
|
252
|
+
</div>
|
|
253
|
+
</Accordion>) : null}
|
|
254
|
+
</>
|
|
236
255
|
);
|
|
237
256
|
}
|
|
238
257
|
return (
|
|
@@ -46,55 +46,53 @@ $primary-tab-height: $spacing-08;
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.properties-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
border-bottom: 0;
|
|
54
|
-
}
|
|
49
|
+
.properties-subtabs,
|
|
50
|
+
.properties-primaryTabs {
|
|
51
|
+
.cds--tabs__nav {
|
|
52
|
+
overflow-x: auto; // override carbon so scrollbar doesn't always show
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
55
|
|
|
58
|
-
.properties-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
color: $text-primary;
|
|
56
|
+
.properties-categories {
|
|
57
|
+
.properties-category-content .cds--accordion__content {
|
|
58
|
+
padding: $spacing-05;
|
|
62
59
|
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
/*
|
|
61
|
+
Accordion Carbon Component currently doesn't support Accordions inside an Accordion
|
|
62
|
+
By default inner Accordions will be in open state and won't close on click
|
|
63
|
+
*/
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
65
|
+
// Handle Initial state where Accordion is closed to hide the content and rotate arrow to indicate the same.
|
|
66
|
+
.cds--accordion__item {
|
|
67
|
+
.cds--accordion__content {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.cds--accordion__arrow {
|
|
72
|
+
transform: rotate(90deg);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Handle Open state where Accordion is opened to show the content and rotate arrow.
|
|
77
|
+
.cds--accordion__item.cds--accordion__item--active {
|
|
78
|
+
.cds--accordion__content {
|
|
79
|
+
display: block;
|
|
80
|
+
}
|
|
81
|
+
.cds--accordion__arrow {
|
|
82
|
+
transform: rotate(270deg);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
82
85
|
}
|
|
83
|
-
}
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
display: none;
|
|
90
|
-
&.show {
|
|
91
|
-
display: inherit;
|
|
87
|
+
// Remove Default borders for Accordions
|
|
88
|
+
.properties-category-content {
|
|
89
|
+
border-top: 0px;
|
|
90
|
+
border-bottom: 1px solid $layer-accent-01;
|
|
92
91
|
}
|
|
93
|
-
}
|
|
94
92
|
|
|
95
|
-
|
|
96
|
-
.cds--
|
|
97
|
-
|
|
93
|
+
// Remove default accordion padding
|
|
94
|
+
.properties-category-content .cds--accordion__wrapper {
|
|
95
|
+
padding: 0;
|
|
98
96
|
}
|
|
99
97
|
}
|
|
100
98
|
|
|
@@ -125,7 +123,6 @@ $primary-tab-height: $spacing-08;
|
|
|
125
123
|
.properties-link-text-container {
|
|
126
124
|
display: flex;
|
|
127
125
|
align-items: center;
|
|
128
|
-
padding: $spacing-04 0 0 0;
|
|
129
126
|
svg {
|
|
130
127
|
margin-right: $spacing-03;
|
|
131
128
|
}
|
|
@@ -143,7 +140,8 @@ $primary-tab-height: $spacing-08;
|
|
|
143
140
|
}
|
|
144
141
|
|
|
145
142
|
// Display in full height if inside a tearsheet
|
|
146
|
-
.properties-editor-form.tearsheet-container,
|
|
143
|
+
.properties-editor-form.tearsheet-container,
|
|
144
|
+
.properties-editor-form.right-flyout-tabs-view {
|
|
147
145
|
height: 100%;
|
|
148
146
|
|
|
149
147
|
.properties-primaryTabs {
|
|
@@ -152,7 +150,8 @@ $primary-tab-height: $spacing-08;
|
|
|
152
150
|
border-bottom: 1px solid $layer-accent-01;
|
|
153
151
|
}
|
|
154
152
|
|
|
155
|
-
.properties-primary-tab-panel.tearsheet-container,
|
|
153
|
+
.properties-primary-tab-panel.tearsheet-container,
|
|
154
|
+
.properties-primary-tab-panel.right-flyout-tabs-view {
|
|
156
155
|
height: calc(100% - #{$primary-tab-height});
|
|
157
156
|
position: relative;
|
|
158
157
|
top: $primary-tab-height;
|
|
@@ -23,6 +23,7 @@ import { PropertyDef } from "./../form/PropertyDef";
|
|
|
23
23
|
import { makeControl } from "./../form/EditorForm";
|
|
24
24
|
import { L10nProvider } from "./../util/L10nProvider";
|
|
25
25
|
import * as ControlUtils from "./../util/control-utils";
|
|
26
|
+
import { Layer } from "@carbon/react";
|
|
26
27
|
|
|
27
28
|
import TextfieldControl from "./textfield";
|
|
28
29
|
import ReadonlyControl from "./readonly";
|
|
@@ -346,6 +347,12 @@ export default class ControlFactory {
|
|
|
346
347
|
createdControl = (<ReadonlyControl {...props} />);
|
|
347
348
|
}
|
|
348
349
|
|
|
350
|
+
const createdControlLayered = (
|
|
351
|
+
<Layer level={this.controller.getLight() && control.light ? 1 : 0} className="properties-control-layer">
|
|
352
|
+
{createdControl}
|
|
353
|
+
</Layer>
|
|
354
|
+
);
|
|
355
|
+
|
|
349
356
|
/*
|
|
350
357
|
* <ControlItem /> should be called from every control.
|
|
351
358
|
* Adding this temporary condition so that we can change one control at a time.
|
|
@@ -366,12 +373,12 @@ export default class ControlFactory {
|
|
|
366
373
|
className
|
|
367
374
|
)}
|
|
368
375
|
>
|
|
369
|
-
{
|
|
376
|
+
{createdControlLayered}
|
|
370
377
|
{action}
|
|
371
378
|
</div>
|
|
372
379
|
);
|
|
373
380
|
}
|
|
374
|
-
return
|
|
381
|
+
return createdControlLayered;
|
|
375
382
|
}
|
|
376
383
|
|
|
377
384
|
/**
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import React from "react";
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
19
|
import { connect } from "react-redux";
|
|
20
|
-
import { TextInput
|
|
20
|
+
import { TextInput } from "@carbon/react";
|
|
21
21
|
import ValidationMessage from "./../../components/validation-message";
|
|
22
22
|
import * as ControlUtils from "./../../util/control-utils";
|
|
23
23
|
import { parse, format, isValid } from "date-fns";
|
|
@@ -73,19 +73,17 @@ class DatefieldControl extends React.Component {
|
|
|
73
73
|
const validationProps = ControlUtils.getValidationProps(this.props.messageInfo, this.props.tableControl);
|
|
74
74
|
return (
|
|
75
75
|
<div className={className} data-id={ControlUtils.getDataId(this.props.propertyId)}>
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/>
|
|
88
|
-
</Layer>
|
|
76
|
+
<TextInput
|
|
77
|
+
{...validationProps}
|
|
78
|
+
autoComplete="off"
|
|
79
|
+
id={this.id}
|
|
80
|
+
disabled={this.props.state === STATES.DISABLED}
|
|
81
|
+
placeholder={this.props.control.additionalText}
|
|
82
|
+
onChange={this.handleChange.bind(this)}
|
|
83
|
+
value={this.value}
|
|
84
|
+
labelText={this.props.controlItem}
|
|
85
|
+
hideLabel={this.props.tableControl}
|
|
86
|
+
/>
|
|
89
87
|
<ValidationMessage inTable={this.props.tableControl} tableOnly state={this.props.state} messageInfo={this.props.messageInfo} />
|
|
90
88
|
</div>
|
|
91
89
|
);
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import React from "react";
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
19
|
import { connect } from "react-redux";
|
|
20
|
-
import { DatePicker, DatePickerInput
|
|
20
|
+
import { DatePicker, DatePickerInput } from "@carbon/react";
|
|
21
21
|
import classNames from "classnames";
|
|
22
22
|
|
|
23
23
|
import ValidationMessage from "../../components/validation-message";
|
|
@@ -71,28 +71,26 @@ class DatepickerControl extends React.Component {
|
|
|
71
71
|
|
|
72
72
|
return (
|
|
73
73
|
<div className={className} data-id={ControlUtils.getDataId(this.props.propertyId)}>
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
</DatePicker>
|
|
95
|
-
</Layer>
|
|
74
|
+
<DatePicker
|
|
75
|
+
className="properties-datepicker-wrapper-parent"
|
|
76
|
+
datePickerType={DATEPICKER_TYPE.SINGLE}
|
|
77
|
+
dateFormat={this.dateFormat}
|
|
78
|
+
onChange={this.handleChange.bind(this)}
|
|
79
|
+
locale={this.locale}
|
|
80
|
+
>
|
|
81
|
+
<DatePickerInput
|
|
82
|
+
{...validationProps}
|
|
83
|
+
id={this.id}
|
|
84
|
+
className="properties-datepicker-wrapper-input"
|
|
85
|
+
placeholder={this.props.control.additionalText}
|
|
86
|
+
labelText={!this.props.tableControl && this.props.controlItem}
|
|
87
|
+
disabled={this.props.state === STATES.DISABLED}
|
|
88
|
+
size={this.getDatepickerSize()}
|
|
89
|
+
onChange={this.handleInputChange.bind(this)}
|
|
90
|
+
value={this.state.value}
|
|
91
|
+
helperText={!this.props.tableControl && helperText}
|
|
92
|
+
/>
|
|
93
|
+
</DatePicker>
|
|
96
94
|
<ValidationMessage inTable={this.props.tableControl} tableOnly state={this.props.state} messageInfo={this.props.messageInfo} />
|
|
97
95
|
</div>
|
|
98
96
|
);
|