@agilemotion/oui-react-js 1.7.0 → 1.7.2
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/ApplicationManager.js +8 -3
- package/dist/BasicAppHome.js +1 -1
- package/dist/DynamicJS.js +5 -2
- package/dist/InteractionPortalAppHome.js +5 -0
- package/dist/RestService.js +344 -0
- package/dist/RestUtils.js +22 -8
- package/dist/Utils.js +9 -0
- package/dist/components/AlertBar.js +3 -0
- package/dist/components/DataGrid.js +72 -43
- package/dist/components/DocumentTemplateDesigner.css +2 -2
- package/dist/components/DocumentTemplateDesigner.js +43 -31
- package/dist/components/DocumentTemplateDesignerComponent.css +6 -159
- package/dist/components/DocumentTemplateDesignerComponent.js +368 -72
- package/dist/components/DocumentTemplatePlaceholderDialog.js +6 -6
- package/dist/components/DocumentViewer.css +10 -0
- package/dist/components/DocumentViewer.js +95 -45
- package/dist/components/Graph.js +12 -2
- package/dist/components/GraphNode.js +0 -2
- package/dist/components/{DocumentViewerComponent.js → PDFViewer.js} +2 -2
- package/dist/components/TabPage.js +7 -3
- package/dist/components/TabPanel.js +13 -3
- package/dist/components/TableCellContent.js +21 -4
- package/dist/components/TemplateDesigner.css +3 -2
- package/dist/components/TemplateDesigner.js +3 -1
- package/dist/components/TemplateItemEventHandler.js +30 -15
- package/dist/components/Toolbar.js +3 -1
- package/dist/components/Tree.js +5 -5
- package/dist/components/WordDocumentViewer.js +167 -0
- package/dist/components/dashboard/SideMenuModuleDashboard.js +1 -3
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.css +4 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +131 -159
- package/dist/components/form/AutoComplete.js +28 -6
- package/dist/components/form/BaseField.js +3 -3
- package/dist/components/form/DatePicker.js +7 -2
- package/dist/components/form/FieldSet.js +24 -8
- package/dist/components/form/Form.js +4 -3
- package/dist/components/form/GridField.js +13 -37
- package/dist/components/form/LookupField.js +23 -23
- package/dist/components/form/RadioGroup.js +2 -1
- package/dist/components/form/Section.js +4 -0
- package/dist/components/form/SelectItem.js +2 -3
- package/dist/components/form/TextField.js +6 -6
- package/dist/components/layout/Layout.js +24 -15
- package/dist/components/menu/MenuButton.js +12 -7
- package/dist/components/menu/MenuLink.js +6 -0
- package/dist/components/signatures/AgilitySignaturePanel.js +33 -14
- package/dist/components/signatures/DocumentContainer.css +26 -1
- package/dist/components/signatures/DocumentContainer.js +55 -10
- package/dist/components/signatures/SignatureInputProps.js +59 -9
- package/dist/components/signatures/SignatureTemplateDesigner.js +71 -38
- package/dist/event/ActionHandlers.js +7 -4
- package/dist/event/RouteActionHandler.js +3 -3
- package/dist/event/ScriptActionHandler.js +2 -2
- package/dist/event/ServiceCallActionHandler.js +73 -28
- package/dist/js/Docs.js +57 -10
- package/dist/view/Dashboard.js +3 -3
- package/package.json +10 -5
- package/dist/components/DocumentView.css +0 -4
|
@@ -11,11 +11,18 @@ var _ApplicationManager = _interopRequireDefault(require("../ApplicationManager"
|
|
|
11
11
|
var _RestUtils = require("../RestUtils");
|
|
12
12
|
var _ServiceCallActionHandler = _interopRequireDefault(require("../event/ServiceCallActionHandler"));
|
|
13
13
|
var _DynamicJS = _interopRequireDefault(require("../DynamicJS"));
|
|
14
|
-
require("./
|
|
15
|
-
var
|
|
14
|
+
require("./DocumentViewer.css");
|
|
15
|
+
var _PDFViewer = _interopRequireDefault(require("./PDFViewer"));
|
|
16
|
+
var _WordDocumentViewer = _interopRequireDefault(require("./WordDocumentViewer"));
|
|
17
|
+
var _Event = _interopRequireDefault(require("../event/Event"));
|
|
18
|
+
var _EventType = _interopRequireDefault(require("../event/EventType"));
|
|
16
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
20
|
const DocumentViewer = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
21
|
+
const [loading, setLoading] = _react.default.useState(true);
|
|
22
|
+
const [label, setLabel] = _react.default.useState(null);
|
|
23
|
+
const [hasLoadingError, setHasLoadingError] = _react.default.useState(false);
|
|
18
24
|
const [value, setValue] = _react.default.useState(null);
|
|
25
|
+
const wordEditorValueHandler = {};
|
|
19
26
|
_react.default.useEffect(() => {
|
|
20
27
|
props.handle.api = api();
|
|
21
28
|
});
|
|
@@ -23,55 +30,80 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.def
|
|
|
23
30
|
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
24
31
|
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
|
|
25
32
|
_Observable.default.addSystemSubscriptions(props.viewId, parsedConfig);
|
|
33
|
+
let label = _Utils.default.getComponentAttribute(props.config, 'label', '');
|
|
34
|
+
setLabel(_DynamicJS.default.evaluateExpression(label));
|
|
35
|
+
let event = new _Event.default(props.handle, props.viewId, null);
|
|
36
|
+
_Observable.default.fireEvent(_EventType.default.COMPONENT_LOAD, event);
|
|
26
37
|
}, []);
|
|
38
|
+
function doLoadData(actionConfig) {
|
|
39
|
+
if (!_Utils.default.isNull(actionConfig) && !_Utils.default.isNull(actionConfig.value)) {
|
|
40
|
+
let value = _ApplicationManager.default.isExpression(actionConfig.value) ? _ApplicationManager.default.resolveExpressionValue(actionConfig.value) : actionConfig.value;
|
|
41
|
+
// TODO : set value
|
|
42
|
+
} else {
|
|
43
|
+
let service = !_Utils.default.isNull(props.config.dataService) ? props.config.dataService : actionConfig !== null ? actionConfig.dataService : null;
|
|
44
|
+
if (!_Utils.default.isNull(service)) {
|
|
45
|
+
if (service.type === 'rpc') {
|
|
46
|
+
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId, result => {}, e => {}, parameter => {});
|
|
47
|
+
} else {
|
|
48
|
+
if (_Utils.default.isNull(actionConfig)) {
|
|
49
|
+
actionConfig = {};
|
|
50
|
+
}
|
|
51
|
+
actionConfig.service = service;
|
|
52
|
+
// TODO : Implement the invalid paramenter callback
|
|
53
|
+
_ServiceCallActionHandler.default.execute(actionConfig, null, null, props.viewId, data => {
|
|
54
|
+
let file = {};
|
|
55
|
+
if (data.payloadBase64) {
|
|
56
|
+
file.base64 = data.payloadBase64;
|
|
57
|
+
} else if (data.url) {
|
|
58
|
+
file.base64 = data.url.replace('data:application/pdf;base64,', '').replace('data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,', '');
|
|
59
|
+
}
|
|
60
|
+
file.name = data.name;
|
|
61
|
+
file.type = props.config.fileType;
|
|
62
|
+
setValue(file);
|
|
63
|
+
setHasLoadingError(false);
|
|
64
|
+
setLoading(false);
|
|
65
|
+
let event = new _Event.default(props.handle, props.viewId, null);
|
|
66
|
+
_Observable.default.fireEvent(_EventType.default.DATA_ARRIVED, event);
|
|
67
|
+
}, e => {
|
|
68
|
+
console.error(e);
|
|
69
|
+
setHasLoadingError(true);
|
|
70
|
+
setLoading(false);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
let componentValue = !_Utils.default.isNull(props.config.value) ? props.config.value : actionConfig !== null ? actionConfig.value : null;
|
|
75
|
+
if (!_Utils.default.isNull(componentValue)) {
|
|
76
|
+
if (_ApplicationManager.default.isExpression(componentValue)) {
|
|
77
|
+
let path = _Utils.default.getPropertyChainPath(componentValue);
|
|
78
|
+
if (!_Utils.default.isNull(path.valueObject)) {
|
|
79
|
+
_Observable.default.addSystemGeneratedSubscription(props.viewId, props.viewId, props.config.id, () => {
|
|
80
|
+
let value = _DynamicJS.default.executeScript(`${props.config.id}ValueEvaluator`, componentValue);
|
|
81
|
+
if (!_Utils.default.isNull(value)) {
|
|
82
|
+
// TODO : set value
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
27
91
|
const api = () => {
|
|
28
92
|
return {
|
|
29
93
|
get id() {
|
|
30
94
|
return props.config.id;
|
|
31
95
|
},
|
|
32
96
|
loadData: actionConfig => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId, result => {}, e => {}, parameter => {});
|
|
42
|
-
} else {
|
|
43
|
-
if (_Utils.default.isNull(actionConfig)) {
|
|
44
|
-
actionConfig = {};
|
|
45
|
-
}
|
|
46
|
-
actionConfig.service = service;
|
|
47
|
-
// TODO : Implement the invalid paramenter callback
|
|
48
|
-
_ServiceCallActionHandler.default.execute(actionConfig, null, null, props.viewId, data => {
|
|
49
|
-
let file = {};
|
|
50
|
-
if (data.payloadBase64) {
|
|
51
|
-
file.base64 = data.payloadBase64;
|
|
52
|
-
} else if (data.url) {
|
|
53
|
-
file.base64 = data.url.replace('data:application/pdf;base64,', '');
|
|
54
|
-
}
|
|
55
|
-
file.type = props.config.fileType;
|
|
56
|
-
setValue(file);
|
|
57
|
-
}, () => {});
|
|
58
|
-
}
|
|
59
|
-
} else {
|
|
60
|
-
if (!_Utils.default.isNull(componentValue)) {
|
|
61
|
-
if (_ApplicationManager.default.isExpression(componentValue)) {
|
|
62
|
-
let path = _Utils.default.getPropertyChainPath(componentValue);
|
|
63
|
-
if (!_Utils.default.isNull(path.valueObject)) {
|
|
64
|
-
_Observable.default.addSystemGeneratedSubscription(props.viewId, props.viewId, props.config.id, () => {
|
|
65
|
-
let value = _DynamicJS.default.executeScript(`${props.config.id}ValueEvaluator`, componentValue);
|
|
66
|
-
if (!_Utils.default.isNull(value)) {
|
|
67
|
-
// TODO : set value
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
97
|
+
doLoadData(actionConfig);
|
|
98
|
+
},
|
|
99
|
+
set label(label) {
|
|
100
|
+
setLabel(label);
|
|
101
|
+
},
|
|
102
|
+
getDocumentValue: async () => {
|
|
103
|
+
if (wordEditorValueHandler.api) {
|
|
104
|
+
return await wordEditorValueHandler.api.getValue();
|
|
74
105
|
}
|
|
106
|
+
return null;
|
|
75
107
|
}
|
|
76
108
|
};
|
|
77
109
|
};
|
|
@@ -83,9 +115,27 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.def
|
|
|
83
115
|
fontSize: '20px',
|
|
84
116
|
color: '#1d253b'
|
|
85
117
|
}
|
|
86
|
-
},
|
|
118
|
+
}, label), loading && /*#__PURE__*/_react.default.createElement("div", {
|
|
119
|
+
style: {
|
|
120
|
+
marginTop: '16px'
|
|
121
|
+
}
|
|
122
|
+
}, "Loading..."), hasLoadingError && /*#__PURE__*/_react.default.createElement("div", {
|
|
123
|
+
style: {
|
|
124
|
+
marginTop: '16px',
|
|
125
|
+
color: 'red'
|
|
126
|
+
}
|
|
127
|
+
}, "Error loading document"), !loading && !hasLoadingError && props.config.fileType === 'application/pdf' && !_Utils.default.isNull(value) && /*#__PURE__*/_react.default.createElement(_PDFViewer.default, {
|
|
87
128
|
file: value,
|
|
88
129
|
onDocumentLoadSuccess: () => {}
|
|
89
|
-
})
|
|
130
|
+
}), !loading && !hasLoadingError && props.config.fileType === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' && !_Utils.default.isNull(value) && /*#__PURE__*/_react.default.createElement(_WordDocumentViewer.default, {
|
|
131
|
+
file: value,
|
|
132
|
+
onDocumentLoadSuccess: () => {},
|
|
133
|
+
valueHandler: wordEditorValueHandler,
|
|
134
|
+
allowUnresolvedChanges: props.config.allowUnresolvedChanges,
|
|
135
|
+
disableRejectChanges: props.config.disableRejectChanges,
|
|
136
|
+
disableAcceptChanges: props.config.disableAcceptChanges,
|
|
137
|
+
readOnly: props.config.readOnly,
|
|
138
|
+
commentsOnly: props.config.commentsOnly
|
|
139
|
+
}));
|
|
90
140
|
}));
|
|
91
141
|
var _default = exports.default = DocumentViewer;
|
package/dist/components/Graph.js
CHANGED
|
@@ -50,14 +50,19 @@ class Graph {
|
|
|
50
50
|
get title() {
|
|
51
51
|
return this.config.title;
|
|
52
52
|
}
|
|
53
|
-
init = () => {
|
|
53
|
+
init = async () => {
|
|
54
54
|
let root = this.config.nodes[0];
|
|
55
55
|
this.current = new _GraphNode.default(this.config.nodes[0]);
|
|
56
56
|
this.addNodeToPath(this.current);
|
|
57
57
|
if (root.action.actionType === 'route') {
|
|
58
58
|
root.action.window = this.config.isWindow;
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
if (root.onStart) {
|
|
61
|
+
for (const action of root.onStart.actions) {
|
|
62
|
+
await _ActionHandlers.default.invokeHandler(action, null, null, this.config.id);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
await _ActionHandlers.default.invokeHandler(root.action, null, null, this.config.id);
|
|
61
66
|
};
|
|
62
67
|
signal = event => {
|
|
63
68
|
let nextNodeName = this.current.getNextNode(event);
|
|
@@ -72,6 +77,11 @@ class Graph {
|
|
|
72
77
|
if (node.action.actionType === 'route') {
|
|
73
78
|
node.action.window = this.config.isWindow;
|
|
74
79
|
}
|
|
80
|
+
if (node.onStart) {
|
|
81
|
+
for (const action of node.onStart.actions) {
|
|
82
|
+
_ActionHandlers.default.invokeHandler(action, null, null, this.config.id);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
75
85
|
_ActionHandlers.default.invokeHandler(node.action, null, null, this.config.id);
|
|
76
86
|
break;
|
|
77
87
|
}
|
|
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _ApplicationManager = _interopRequireDefault(require("../ApplicationManager"));
|
|
8
|
-
var _ActionHandlers = _interopRequireDefault(require("../event/ActionHandlers"));
|
|
9
7
|
var _DynamicJS = _interopRequireDefault(require("./../DynamicJS"));
|
|
10
8
|
var _Utils = _interopRequireDefault(require("./../Utils"));
|
|
11
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -9,7 +9,7 @@ var _reactPdf = require("react-pdf");
|
|
|
9
9
|
var _Utils = _interopRequireDefault(require("../Utils"));
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
_reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${_reactPdf.pdfjs.version}/pdf.worker.js`;
|
|
12
|
-
const
|
|
12
|
+
const PDFViewer = props => {
|
|
13
13
|
const [pageNumber, setPageNumber] = _react.default.useState(1);
|
|
14
14
|
const [numPages, setNumPages] = _react.default.useState(null);
|
|
15
15
|
const onDocumentLoadSuccess = _ref => {
|
|
@@ -58,4 +58,4 @@ const DocumentViewerComponent = props => {
|
|
|
58
58
|
alt: ''
|
|
59
59
|
}), props.onDocumentLoadSuccess(1))) : null);
|
|
60
60
|
};
|
|
61
|
-
var _default = exports.default =
|
|
61
|
+
var _default = exports.default = PDFViewer;
|
|
@@ -39,9 +39,9 @@ const TabPage = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.fo
|
|
|
39
39
|
let componentKey = 0;
|
|
40
40
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
41
41
|
ref: ref,
|
|
42
|
-
style: {
|
|
42
|
+
style: _Utils.default.mergeStyles({
|
|
43
43
|
width: "inherit"
|
|
44
|
-
}
|
|
44
|
+
}, props.config)
|
|
45
45
|
}, /*#__PURE__*/_react.default.createElement(_Typography.default, _extends({
|
|
46
46
|
component: "div",
|
|
47
47
|
className: "w-100",
|
|
@@ -51,7 +51,11 @@ const TabPage = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.fo
|
|
|
51
51
|
"aria-labelledby": `simple-tab-${index}`
|
|
52
52
|
}, other), /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
53
53
|
p: 3,
|
|
54
|
-
className: classes.formTabPanel
|
|
54
|
+
className: classes.formTabPanel,
|
|
55
|
+
style: {
|
|
56
|
+
margin: 0,
|
|
57
|
+
padding: 0
|
|
58
|
+
}
|
|
55
59
|
}, children)));
|
|
56
60
|
}));
|
|
57
61
|
TabPage.propTypes = {
|
|
@@ -96,7 +96,7 @@ const TabPanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
96
96
|
}
|
|
97
97
|
const api = () => {
|
|
98
98
|
return {
|
|
99
|
-
|
|
99
|
+
get id() {
|
|
100
100
|
return props.config.id;
|
|
101
101
|
},
|
|
102
102
|
getChildren: () => {
|
|
@@ -112,6 +112,15 @@ const TabPanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
return children;
|
|
115
|
+
},
|
|
116
|
+
setPageHasError: (pageId, hasError) => {
|
|
117
|
+
setErrors({
|
|
118
|
+
...errors,
|
|
119
|
+
[pageId]: hasError
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
clearErrors: () => {
|
|
123
|
+
setErrors({});
|
|
115
124
|
}
|
|
116
125
|
};
|
|
117
126
|
};
|
|
@@ -140,7 +149,7 @@ const TabPanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
140
149
|
}, a11yProps(index), {
|
|
141
150
|
key: index,
|
|
142
151
|
style: {
|
|
143
|
-
color: _ApplicationManager.default.isFormMarkersEnabled() &&
|
|
152
|
+
color: _ApplicationManager.default.isFormMarkersEnabled() && errors !== null && errors[page.id] === true ? '#ed5249' : null
|
|
144
153
|
}
|
|
145
154
|
}));
|
|
146
155
|
}) : null)), !_Utils.default.isNull(props.config) && !_Utils.default.isNull(props.config.tabPages) && props.config.tabPages.length > 0 ? props.config.tabPages.map((page, index) => {
|
|
@@ -150,7 +159,8 @@ const TabPanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
150
159
|
return /*#__PURE__*/_react.default.createElement(_TabPage.default, {
|
|
151
160
|
value: tabValue,
|
|
152
161
|
key: index,
|
|
153
|
-
index: index
|
|
162
|
+
index: index,
|
|
163
|
+
config: page
|
|
154
164
|
}, renderPage(page, index));
|
|
155
165
|
}) : null);
|
|
156
166
|
}));
|
|
@@ -13,6 +13,7 @@ var _LookupField = _interopRequireDefault(require("./form/LookupField"));
|
|
|
13
13
|
var _Error = _interopRequireDefault(require("@material-ui/icons/Error"));
|
|
14
14
|
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
|
|
15
15
|
var _ApplicationManager = _interopRequireDefault(require("../ApplicationManager"));
|
|
16
|
+
var _AutoComplete = _interopRequireDefault(require("./form/AutoComplete"));
|
|
16
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
18
|
const TableCellContent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
18
19
|
const [contentType] = _react.default.useState(props.contentType);
|
|
@@ -65,6 +66,8 @@ const TableCellContent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
|
|
|
65
66
|
props.editor.attributes = {};
|
|
66
67
|
}
|
|
67
68
|
props.editor.attributes['minWidth'] = 0;
|
|
69
|
+
|
|
70
|
+
// This forces the editable grid to validate its initial value
|
|
68
71
|
let value = props.row[props.dataBinding];
|
|
69
72
|
valueChangeHandler(_Utils.default.isNull(value) ? null : value);
|
|
70
73
|
}
|
|
@@ -156,10 +159,6 @@ const TableCellContent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
|
|
|
156
159
|
} else if (props.editor.fieldType === 'LOOKUP') {
|
|
157
160
|
let data = props.row[props.dataBinding];
|
|
158
161
|
if (!_Utils.default.isNull(data)) {
|
|
159
|
-
if (!_Utils.default.isNull(data.map)) {
|
|
160
|
-
data = data.map;
|
|
161
|
-
props.formValues[props.editor.id] = data;
|
|
162
|
-
}
|
|
163
162
|
data.toString = () => {
|
|
164
163
|
return data.label;
|
|
165
164
|
};
|
|
@@ -175,6 +174,24 @@ const TableCellContent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
|
|
|
175
174
|
value: data,
|
|
176
175
|
viewId: props.viewId
|
|
177
176
|
});
|
|
177
|
+
} else if (props.editor.fieldType === 'AUTO_COMPLETE') {
|
|
178
|
+
let data = props.row[props.dataBinding];
|
|
179
|
+
if (!_Utils.default.isNull(data)) {
|
|
180
|
+
data.toString = () => {
|
|
181
|
+
return "12345";
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
return /*#__PURE__*/_react.default.createElement(_AutoComplete.default, {
|
|
185
|
+
valueChangeHandler: valueChangeHandler,
|
|
186
|
+
config: props.editor,
|
|
187
|
+
form: props.form,
|
|
188
|
+
handle: {},
|
|
189
|
+
ref: /*#__PURE__*/_react.default.createRef(),
|
|
190
|
+
bindValueToForm: false,
|
|
191
|
+
values: props.formValues,
|
|
192
|
+
value: data,
|
|
193
|
+
viewId: props.viewId
|
|
194
|
+
});
|
|
178
195
|
}
|
|
179
196
|
} else {
|
|
180
197
|
return getStaticDisplayValue();
|
|
@@ -270,7 +270,9 @@ const TemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.d
|
|
|
270
270
|
document.getElementsByTagName('body')[0].style.cursor = 'grabbing';
|
|
271
271
|
setGrabbedItem(item);
|
|
272
272
|
};
|
|
273
|
-
return /*#__PURE__*/_react.default.createElement("div",
|
|
273
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
274
|
+
className: 'templateDesigner'
|
|
275
|
+
}, !_Utils.default.isNull(props.config) && !loading ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
274
276
|
style: {
|
|
275
277
|
width: '100%',
|
|
276
278
|
height: '60px',
|
|
@@ -67,7 +67,9 @@ class TemplateItemEventHandler {
|
|
|
67
67
|
this.resetBorders();
|
|
68
68
|
this.selectedNode = null;
|
|
69
69
|
this.selectedNodeInitPosition = null;
|
|
70
|
-
selectionHandler
|
|
70
|
+
if (selectionHandler) {
|
|
71
|
+
selectionHandler(null);
|
|
72
|
+
}
|
|
71
73
|
}
|
|
72
74
|
this.tableItemPreResizeWidth = null;
|
|
73
75
|
this.tableItemPreResizeHeight = null;
|
|
@@ -80,19 +82,26 @@ class TemplateItemEventHandler {
|
|
|
80
82
|
let width = props.width;
|
|
81
83
|
let height = props.height;
|
|
82
84
|
let parent = event.target;
|
|
83
|
-
let dropTarget =
|
|
84
|
-
|
|
85
|
+
let dropTarget = this.getDropTarget(parent);
|
|
85
86
|
if (dropTarget) {
|
|
86
87
|
let container = document.getElementById('templateContainer');
|
|
87
88
|
let node = document.createElement("div");
|
|
88
89
|
node.id = props.id;
|
|
89
|
-
node.style.
|
|
90
|
-
node.style.left = (props.left ? props.left : event.clientX - dropTarget.offsetLeft) + 'px';
|
|
90
|
+
node.style.left = (props.left ? props.left : container.scrollLeft + event.clientX - dropTarget.offsetLeft) + 'px';
|
|
91
91
|
node.style.top = (props.top ? props.top : container.scrollTop + event.clientY - dropTarget.offsetTop) + 'px';
|
|
92
92
|
node.style.border = '2px dashed green';
|
|
93
|
+
node.style.fontSize = '11px';
|
|
93
94
|
node.style.position = 'absolute';
|
|
95
|
+
node.style.verticalAlign = 'middle';
|
|
96
|
+
node.style.padding = '0 4px';
|
|
94
97
|
node.className = "_draggable_";
|
|
95
98
|
node.setAttribute("draggable", true);
|
|
99
|
+
if (props.sid) {
|
|
100
|
+
node.setAttribute("sid", props.sid);
|
|
101
|
+
}
|
|
102
|
+
if (props.sdesc) {
|
|
103
|
+
node.setAttribute("sdesc", props.sdesc);
|
|
104
|
+
}
|
|
96
105
|
if (props.type === 'TABLE') {
|
|
97
106
|
let table = new _TemplateTable.default(props.table, node).build((resizing, boundary) => {
|
|
98
107
|
this.resizingTableColumn = resizing;
|
|
@@ -104,10 +113,12 @@ class TemplateItemEventHandler {
|
|
|
104
113
|
node.style.padding = '1px';
|
|
105
114
|
node.style.width = parse(table.style.width) + 2 + 'px';
|
|
106
115
|
node.style.height = parse(table.style.height) + 2 + 'px';
|
|
116
|
+
node.style.lineHeight = node.style.height;
|
|
107
117
|
} else {
|
|
108
118
|
node.style.height = height + 'px';
|
|
109
119
|
node.style.width = width + 'px';
|
|
110
|
-
node.
|
|
120
|
+
node.style.lineHeight = node.style.height;
|
|
121
|
+
node.innerHTML = props.description;
|
|
111
122
|
}
|
|
112
123
|
node.addEventListener('dragend', event => this.handleItemDrop(event, dropTarget), false);
|
|
113
124
|
let placeHolders = dropTarget.getElementsByClassName('__sys_placeholders')[0];
|
|
@@ -135,9 +146,9 @@ class TemplateItemEventHandler {
|
|
|
135
146
|
return dropTarget;
|
|
136
147
|
}
|
|
137
148
|
handleItemDrop = (event, target) => {
|
|
138
|
-
console.log("\n\n\n\nclientY : " + event.clientY + " offsetTop : " + target.offsetTop + " dragOffset.y : " + this.dragOffset.y);
|
|
139
|
-
event.target.style.left = event.clientX -
|
|
140
|
-
event.target.style.top = event.clientY -
|
|
149
|
+
//console.log("\n\n\n\nclientY : " + event.clientY + " offsetTop : " + target.offsetTop + " dragOffset.y : " + this.dragOffset.y);
|
|
150
|
+
event.target.style.left = event.clientX - this.dragOffset.x + 'px';
|
|
151
|
+
event.target.style.top = event.clientY - this.dragOffset.y + 'px';
|
|
141
152
|
event.preventDefault();
|
|
142
153
|
this.currentResizeNode = null;
|
|
143
154
|
this.mouseDown = false;
|
|
@@ -223,22 +234,22 @@ class TemplateItemEventHandler {
|
|
|
223
234
|
}
|
|
224
235
|
}
|
|
225
236
|
resizeNode = (event, node) => {
|
|
226
|
-
//console.log(this.mouseDown + " : " + node + " : " + this.resizingTableColumn);
|
|
227
237
|
if (this.mouseDown && node) {
|
|
228
238
|
let container = document.getElementById('templateContainer');
|
|
229
239
|
if (container) {
|
|
230
|
-
let mouseX = event.clientX - this.resizingItemParent.
|
|
231
|
-
let mouseY = event.clientY - this.resizingItemParent.
|
|
240
|
+
let mouseX = event.clientX - this.resizingItemParent.getBoundingClientRect().left;
|
|
241
|
+
let mouseY = event.clientY - this.resizingItemParent.getBoundingClientRect().top;
|
|
232
242
|
let resizeSpec = {
|
|
233
243
|
leftOffset: 0,
|
|
234
244
|
rightOffset: 0,
|
|
235
245
|
topOffset: 0,
|
|
236
246
|
bottomOffset: 0
|
|
237
247
|
};
|
|
248
|
+
console.log("X : " + event.clientX + " Y : " + event.clientY + " MX : " + mouseX + " NL : " + node.style.left);
|
|
238
249
|
if (this.boundCheckLeft) {
|
|
239
250
|
let widthDiff = mouseX - parse(node.style.left);
|
|
240
251
|
let newWidth = parse(node.style.width) - widthDiff;
|
|
241
|
-
|
|
252
|
+
console.log("WD : " + widthDiff + " NW : " + newWidth + " MX : " + mouseX + " NL : " + node.style.left);
|
|
242
253
|
//console.log("\n\n\n SETTING SPEC LEFT : " + this.selectedNodeInitPosition.left);
|
|
243
254
|
resizeSpec.leftOffset = mouseX - this.selectedNodeInitPosition.left;
|
|
244
255
|
if (newWidth >= 20) {
|
|
@@ -259,6 +270,7 @@ class TemplateItemEventHandler {
|
|
|
259
270
|
resizeSpec.topOffset = mouseY - this.selectedNodeInitPosition.top;
|
|
260
271
|
if (newHeight >= 20) {
|
|
261
272
|
node.style.height = newHeight + 'px';
|
|
273
|
+
node.style.lineHeight = newHeight + 'px';
|
|
262
274
|
node.style.top = mouseY + 'px';
|
|
263
275
|
}
|
|
264
276
|
resizeSpec.topResized = true;
|
|
@@ -268,6 +280,7 @@ class TemplateItemEventHandler {
|
|
|
268
280
|
resizeSpec.bottomOffset = newHeight - this.selectedNodeInitPosition.height;
|
|
269
281
|
if (newHeight >= 20) {
|
|
270
282
|
node.style.height = newHeight + 'px';
|
|
283
|
+
node.style.lineHeight = newHeight + 'px';
|
|
271
284
|
}
|
|
272
285
|
resizeSpec.bottomResized = true;
|
|
273
286
|
}
|
|
@@ -283,7 +296,7 @@ class TemplateItemEventHandler {
|
|
|
283
296
|
let top = parse(node.style.top) + itemParent.offsetTop;
|
|
284
297
|
let bottom = top + parse(node.style.height);
|
|
285
298
|
let mouseX = event.clientX + container.scrollLeft;
|
|
286
|
-
let mouseY = event.clientY
|
|
299
|
+
let mouseY = event.clientY - itemParent.getBoundingClientRect().top;
|
|
287
300
|
this.boundCheckTop = boundCheck(top, mouseY);
|
|
288
301
|
this.boundCheckLeft = boundCheck(left, mouseX);
|
|
289
302
|
this.boundCheckRight = boundCheck(right, mouseX);
|
|
@@ -322,7 +335,9 @@ class TemplateItemEventHandler {
|
|
|
322
335
|
node.style.border = '2px dashed green';
|
|
323
336
|
this.selectedNode = node;
|
|
324
337
|
this.setSelectedInitNodePos();
|
|
325
|
-
selectionHandler
|
|
338
|
+
if (selectionHandler) {
|
|
339
|
+
selectionHandler(id, node);
|
|
340
|
+
}
|
|
326
341
|
};
|
|
327
342
|
setSelectedInitNodePos() {
|
|
328
343
|
this.selectedNodeInitPosition = {
|
|
@@ -103,7 +103,9 @@ const Toolbar = props => {
|
|
|
103
103
|
_Observable.default.addSystemSubscriptions(props.viewId, parsedConfig);
|
|
104
104
|
for (const section of config.sections) {
|
|
105
105
|
for (const item of section.items) {
|
|
106
|
-
|
|
106
|
+
if (item.type !== 'toolbarSpacer') {
|
|
107
|
+
allItems.push(item);
|
|
108
|
+
}
|
|
107
109
|
}
|
|
108
110
|
}
|
|
109
111
|
}
|
package/dist/components/Tree.js
CHANGED
|
@@ -73,8 +73,8 @@ function TransitionComponent(props) {
|
|
|
73
73
|
}, /*#__PURE__*/_react.default.createElement(_Collapse.default, props));
|
|
74
74
|
}
|
|
75
75
|
TransitionComponent.propTypes = {
|
|
76
|
-
/**
|
|
77
|
-
* Show the component; triggers the enter or exit states
|
|
76
|
+
/**
|
|
77
|
+
* Show the component; triggers the enter or exit states
|
|
78
78
|
*/
|
|
79
79
|
in: _propTypes.default.bool
|
|
80
80
|
};
|
|
@@ -122,9 +122,9 @@ const Tree = exports.Tree = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
|
122
122
|
if (!_Utils.default.isNull(service)) {
|
|
123
123
|
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId, result => {
|
|
124
124
|
try {
|
|
125
|
-
if (result
|
|
126
|
-
expand(result
|
|
127
|
-
setRoot(result
|
|
125
|
+
if (result) {
|
|
126
|
+
expand(result);
|
|
127
|
+
setRoot(result);
|
|
128
128
|
}
|
|
129
129
|
} catch (e) {
|
|
130
130
|
console.error(e);
|