@agilemotion/oui-react-js 1.3.5 → 1.3.6
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/RestUtils.js +3 -3
- package/dist/Utils.js +1 -1
- package/dist/components/StepperTitleBar.js +1 -2
- package/dist/components/form/FieldSet.js +1 -1
- package/dist/components/form/ImageEditor.js +2 -6
- package/dist/components/menu/MenuButton.js +0 -3
- package/dist/event/RouteActionHandler.js +37 -33
- package/dist/js/Addresses.js +13 -13
- package/package.json +1 -1
package/dist/RestUtils.js
CHANGED
|
@@ -158,7 +158,7 @@ class RestUtils {
|
|
|
158
158
|
postData(url, response => {
|
|
159
159
|
let responseData = !_Utils.default.isNull(response) ? response.data : null;
|
|
160
160
|
|
|
161
|
-
if (!_Utils.default.isNull(responseData) &&
|
|
161
|
+
if (!_Utils.default.isNull(responseData) && response.dataType === 'message' && responseData.messageType === "ERROR") {
|
|
162
162
|
this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
|
|
163
163
|
} else {
|
|
164
164
|
if (!_Utils.default.isNull(successCallback)) {
|
|
@@ -270,7 +270,7 @@ class RestUtils {
|
|
|
270
270
|
|
|
271
271
|
let responseData = !_Utils.default.isNull(response) ? response.data : null;
|
|
272
272
|
|
|
273
|
-
if (!_Utils.default.isNull(responseData) &&
|
|
273
|
+
if (!_Utils.default.isNull(responseData) && response.dataType === 'message' && responseData.messageType === "ERROR") {
|
|
274
274
|
this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
|
|
275
275
|
} else {
|
|
276
276
|
this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_SUCCESS, response.data);
|
|
@@ -404,7 +404,7 @@ class RestUtils {
|
|
|
404
404
|
if (successCallback !== null) {
|
|
405
405
|
let responseData = !_Utils.default.isNull(response) ? response.data : null;
|
|
406
406
|
|
|
407
|
-
if (!_Utils.default.isNull(responseData) &&
|
|
407
|
+
if (!_Utils.default.isNull(responseData) && response.dataType === 'message') {
|
|
408
408
|
let event = new _Event.default(_ApplicationContext.default, viewId, responseData);
|
|
409
409
|
|
|
410
410
|
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
|
package/dist/Utils.js
CHANGED
|
@@ -190,7 +190,7 @@ class Utils {
|
|
|
190
190
|
|
|
191
191
|
static getFieldGrid(attributes, fields) {
|
|
192
192
|
let fieldGrid = {};
|
|
193
|
-
let maxColspan = !Utils.isNull(attributes) ? attributes.layoutColumns : 1;
|
|
193
|
+
let maxColspan = !Utils.isNull(attributes) && !Utils.isNull(attributes.layoutColumns) ? attributes.layoutColumns : 1;
|
|
194
194
|
fieldGrid.maxColPerRow = maxColspan;
|
|
195
195
|
fieldGrid.rows = [];
|
|
196
196
|
let currRow = this.createRow();
|
|
@@ -193,8 +193,7 @@ const StepperTitleBar = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.de
|
|
|
193
193
|
fontSize: '24px',
|
|
194
194
|
color: '#202124',
|
|
195
195
|
padding: "16px 0",
|
|
196
|
-
margin: "0"
|
|
197
|
-
width: "70%"
|
|
196
|
+
margin: "0"
|
|
198
197
|
}, props.config)
|
|
199
198
|
}, !_Utils.default.isNull(steps) && !_Utils.default.isNull(activeSegmentPercentage) && !_Utils.default.isNull(currentIndex.current) ? render() : null) : null);
|
|
200
199
|
}));
|
|
@@ -540,7 +540,7 @@ const FieldSet = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
540
540
|
style: {
|
|
541
541
|
paddingLeft: '0',
|
|
542
542
|
paddingRight: '0',
|
|
543
|
-
|
|
543
|
+
width: 100 / fieldGrid.maxColPerRow + '%'
|
|
544
544
|
}
|
|
545
545
|
}, renderComponent(field));
|
|
546
546
|
}));
|
|
@@ -368,21 +368,17 @@ const ImageEditorComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_rea
|
|
|
368
368
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
369
369
|
className: classes.button,
|
|
370
370
|
style: {
|
|
371
|
-
width:
|
|
371
|
+
width: 'auto',
|
|
372
372
|
height: parseFloat(height.replace('px', '')) - 20 + 'px',
|
|
373
373
|
maxHeight: parseFloat(height.replace('px', '')) - 20 + 'px',
|
|
374
374
|
textAlign: 'center',
|
|
375
375
|
overflow: 'auto',
|
|
376
|
-
position: 'absolute',
|
|
377
376
|
display: 'flex',
|
|
378
377
|
justifyContent: 'center',
|
|
379
378
|
alignItems: 'center'
|
|
380
379
|
}
|
|
381
380
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
382
|
-
id: "__image_container"
|
|
383
|
-
style: {
|
|
384
|
-
position: 'absolute'
|
|
385
|
-
}
|
|
381
|
+
id: "__image_container"
|
|
386
382
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
387
383
|
id: "__image",
|
|
388
384
|
src: base.value.url,
|
|
@@ -51,7 +51,7 @@ class RouteActionHandler {
|
|
|
51
51
|
} else {
|
|
52
52
|
path = _ApplicationContext.default.isExpression(actionConfig.path) ? _ApplicationContext.default.resolveExpressionValue(actionConfig.path, event.data) : actionConfig.path;
|
|
53
53
|
|
|
54
|
-
if ("@#{history.back}" === actionConfig.path) {
|
|
54
|
+
if ("@#{history.back}" === actionConfig.path && _ApplicationContext.default.graphs.length === 0) {
|
|
55
55
|
let historyElement = _ApplicationContext.default.getPreviousHistoryElement();
|
|
56
56
|
|
|
57
57
|
if (historyElement === null) {
|
|
@@ -87,49 +87,53 @@ class RouteActionHandler {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
if ("@#{history.back}" === actionConfig.path && _ApplicationContext.default.graphs.length > 0) {
|
|
91
|
+
_ApplicationContext.default.removeLoadedGraph();
|
|
92
|
+
} else {
|
|
93
|
+
let url = location + _ApplicationContext.default.getBaseApiUrl() + _ApplicationContext.default.getUIConfigPath() + "/view?version=1.0&id=" + path;
|
|
94
|
+
(0, _RestUtils.sendRequest)(url, data => {
|
|
95
|
+
if (isParent) {
|
|
96
|
+
_ApplicationContext.default.removeLoadedGraph();
|
|
97
|
+
}
|
|
95
98
|
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
if (data.type === 'view') {
|
|
100
|
+
let currentView = _ApplicationContext.default.getCurrentView();
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
if (_Utils.default.isNull(currentView) || !currentView.popUp) {
|
|
103
|
+
let view = {};
|
|
104
|
+
view.config = data;
|
|
105
|
+
view.handle = {};
|
|
106
|
+
view.parameters = parameterValues;
|
|
107
|
+
view.parent = isParent;
|
|
108
|
+
view.popUp = isPopup;
|
|
106
109
|
|
|
107
|
-
|
|
110
|
+
_ApplicationContext.default.addView(view, path, forward); // None-existing route to ensure that the current view unloads
|
|
108
111
|
|
|
109
112
|
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
if (_Utils.default.isNull(actionConfig.popUp) || actionConfig.popUp === false) {
|
|
114
|
+
_ApplicationContext.default.getViewPortHistory().push("/switch");
|
|
112
115
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
_ApplicationContext.default.getViewPortHistory().push("/view/" + data.id);
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
_ApplicationContext.default.closeCurrentView(false);
|
|
117
120
|
|
|
118
|
-
|
|
121
|
+
currentView = _ApplicationContext.default.getCurrentView();
|
|
119
122
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
if (currentView) {
|
|
124
|
+
currentView.handle.api.updateModel(parameterValues);
|
|
125
|
+
let event = new _Event.default(currentView.handle, currentView.config.id, null);
|
|
123
126
|
|
|
124
|
-
|
|
127
|
+
_Observable.default.fireEvent(_EventType.default.COMPONENT_LOAD, event);
|
|
128
|
+
}
|
|
125
129
|
}
|
|
130
|
+
} else if (data.type === 'graph') {
|
|
131
|
+
_ApplicationContext.default.loadGraph(isParent, isPopup, data, parameterValues);
|
|
126
132
|
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
console.error(e);
|
|
132
|
-
}, true, false);
|
|
133
|
+
}, e => {
|
|
134
|
+
console.error(e);
|
|
135
|
+
}, true, false);
|
|
136
|
+
}
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
}
|
package/dist/js/Addresses.js
CHANGED
|
@@ -10,22 +10,22 @@ class Addresses {
|
|
|
10
10
|
this.resolver = resolver;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
copy(from, to, checked) {
|
|
13
|
+
copy(from, to, checked, mode = 'line') {
|
|
14
14
|
if (checked) {
|
|
15
|
-
let street = this.resolver.resolveComponentApi(from + '.street').value;
|
|
16
|
-
let suburb = this.resolver.resolveComponentApi(from + '.suburb').value;
|
|
17
|
-
let city = this.resolver.resolveComponentApi(from + '.city').value;
|
|
18
|
-
let municipality = this.resolver.resolveComponentApi(from + '.municipality').value;
|
|
19
|
-
let province = this.resolver.resolveComponentApi(from + '.province').value;
|
|
20
|
-
let country = this.resolver.resolveComponentApi(from + '.country').value;
|
|
15
|
+
let street = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.street' : '.line1')).value;
|
|
16
|
+
let suburb = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.suburb' : '.line2')).value;
|
|
17
|
+
let city = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.city' : '.line3')).value;
|
|
18
|
+
let municipality = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.municipality' : '.line4')).value;
|
|
19
|
+
let province = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.province' : '.line5')).value;
|
|
20
|
+
let country = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.country' : '.line6')).value;
|
|
21
21
|
let code = this.resolver.resolveComponentApi(from + '.code').value;
|
|
22
22
|
let building = this.resolver.resolveComponentApi(from + '.building').value;
|
|
23
|
-
this.resolver.resolveComponentApi(to + '.street').value = street;
|
|
24
|
-
this.resolver.resolveComponentApi(to + '.suburb').value = suburb;
|
|
25
|
-
this.resolver.resolveComponentApi(to + '.city').value = city;
|
|
26
|
-
this.resolver.resolveComponentApi(to + '.municipality').value = municipality;
|
|
27
|
-
this.resolver.resolveComponentApi(to + '.province').value = province;
|
|
28
|
-
this.resolver.resolveComponentApi(to + '.country').value = country;
|
|
23
|
+
this.resolver.resolveComponentApi(to + (mode === 'street' ? '.street' : '.line1')).value = street;
|
|
24
|
+
this.resolver.resolveComponentApi(to + (mode === 'street' ? '.suburb' : '.line2')).value = suburb;
|
|
25
|
+
this.resolver.resolveComponentApi(to + (mode === 'street' ? '.city' : '.line3')).value = city;
|
|
26
|
+
this.resolver.resolveComponentApi(to + (mode === 'street' ? '.municipality' : '.line4')).value = municipality;
|
|
27
|
+
this.resolver.resolveComponentApi(to + (mode === 'street' ? '.province' : '.line5')).value = province;
|
|
28
|
+
this.resolver.resolveComponentApi(to + (mode === 'street' ? '.country' : '.line6')).value = country;
|
|
29
29
|
this.resolver.resolveComponentApi(to + '.code').value = code;
|
|
30
30
|
this.resolver.resolveComponentApi(to + '.building').value = building;
|
|
31
31
|
}
|