@agilemotion/oui-react-js 1.3.1 → 1.3.3
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/ApplicationContext.js +148 -39
- package/dist/BasicApp.js +12 -5
- package/dist/BasicAppHome.js +18 -12
- package/dist/BusinessPortalApp.css +37 -0
- package/dist/BusinessPortalApp.js +90 -0
- package/dist/BusinessPortalAppHome.js +160 -0
- package/dist/RestUtils.js +65 -40
- package/dist/Utils.js +47 -1
- package/dist/assets/jss/components/footerStyle.js +7 -4
- package/dist/assets/jss/views/loginBasicStyle.js +0 -1
- package/dist/assets/jss/views/loginBusinessPortalStyle.js +76 -0
- package/dist/components/AlertBar.js +40 -11
- package/dist/components/ConfirmationDialog.js +54 -8
- package/dist/components/DataGrid.css +3 -1
- package/dist/components/DataGrid.js +149 -82
- package/dist/components/DataGridFilter.js +85 -8
- package/dist/components/Dialog.js +258 -0
- package/dist/components/Graph.js +26 -18
- package/dist/components/GraphNode.js +0 -2
- package/dist/components/HtmlPanel.js +103 -4
- package/dist/components/Icon.js +60 -0
- package/dist/components/PopupView.js +55 -6
- package/dist/components/SignaturePanel.js +147 -0
- package/dist/components/StepperTitleBar.bck.css +85 -0
- package/dist/components/StepperTitleBar.css +53 -54
- package/dist/components/StepperTitleBar.js +42 -29
- package/dist/components/TabPanel.js +10 -11
- package/dist/components/TableCellContent.js +6 -3
- package/dist/components/TemplateDesigner.css +13 -0
- package/dist/components/TemplateDesigner.js +494 -0
- package/dist/components/TemplateItemEventHandler.js +440 -0
- package/dist/components/TemplateTable.js +222 -0
- package/dist/components/TitleBar.js +21 -14
- package/dist/components/Toolbar.js +7 -5
- package/dist/components/Tree.js +5 -2
- package/dist/components/dashboard/{BasicBusinessApp.js → BasicBusinessAppDashboard.js} +30 -25
- package/dist/components/dashboard/BusinessPortalAppDashboard.css +5 -0
- package/dist/components/dashboard/BusinessPortalAppDashboard.js +236 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +23 -12
- package/dist/components/dashboard/components/portal/Timeline.js +17 -0
- package/dist/components/dashboard/components/portal/Workspace.css +25 -0
- package/dist/components/dashboard/components/portal/Workspace.js +48 -0
- package/dist/components/dashboard/components/portal/portal-dashboard.css +25 -0
- package/dist/components/footer/Footer.js +43 -10
- package/dist/components/form/AddressSearch.js +140 -0
- package/dist/components/form/BaseField.js +42 -8
- package/dist/components/form/Checkbox.js +3 -0
- package/dist/components/form/DatePicker.js +70 -4
- package/dist/components/form/FieldSet.js +247 -72
- package/dist/components/form/Form.js +178 -127
- package/dist/components/form/GridField.js +3 -2
- package/dist/components/form/ImageEditor.js +461 -0
- package/dist/components/form/LabelField.js +2 -2
- package/dist/components/form/LookupField.js +16 -4
- package/dist/components/form/RadioGroup.js +107 -0
- package/dist/components/form/Section.js +58 -19
- package/dist/components/form/SelectItem.js +14 -5
- package/dist/components/form/SignatureTemplateDesignerField.js +46 -0
- package/dist/components/form/TextField.js +5 -9
- package/dist/components/form/TransferList.js +7 -7
- package/dist/components/form/UploadField.js +184 -55
- package/dist/components/form/noimage-person.png +0 -0
- package/dist/components/form/noimage.png +0 -0
- package/dist/components/form/transparent.jpeg +0 -0
- package/dist/components/layout/CollapsiblePanel.js +0 -6
- package/dist/components/layout/Layout.js +49 -19
- package/dist/components/layout/View.css +43 -0
- package/dist/components/layout/View.js +76 -156
- package/dist/components/layout/ViewPort.js +32 -49
- package/dist/components/menu/MenuLink.js +7 -0
- package/dist/components/navbars/HomeNavbar.js +29 -14
- package/dist/components/navbars/PortalNavbar.css +75 -0
- package/dist/components/navbars/PortalNavbar.js +227 -0
- package/dist/components/signatures/AgilitySignaturePanel.js +312 -0
- package/dist/components/signatures/DocumentContainer.css +33 -0
- package/dist/components/signatures/DocumentContainer.js +206 -0
- package/dist/components/signatures/ImageSignatureInput.js +265 -0
- package/dist/components/signatures/ResponsiveTable.js +1 -3
- package/dist/components/signatures/SignatureInput.js +303 -0
- package/dist/components/signatures/SignatureInputProps.js +17 -11
- package/dist/components/signatures/SignatureTemplateDesigner.js +192 -81
- package/dist/components/signatures/transparent.jpeg +0 -0
- package/dist/event/LoadDataActionHandler.js +1 -1
- package/dist/event/Observable.js +1 -1
- package/dist/event/RouteActionHandler.js +18 -5
- package/dist/event/ServiceCallActionHandler.js +7 -3
- package/dist/js/Addresses.js +16 -9
- package/dist/view/Dashboard.js +27 -19
- package/dist/view/PortalDashboard.js +33 -0
- package/dist/view/security/ChangePasswordBasic.js +1 -0
- package/dist/view/security/ForgotPasswordBasic.js +1 -0
- package/dist/view/security/LoginBasic.js +6 -1
- package/dist/view/security/LoginBusinessPortal.js +268 -0
- package/dist/view/security/ResetPasswordBasic.js +1 -0
- package/package.json +25 -21
- package/dist/assets/img/flogo.png +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Dialog = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _Utils = _interopRequireDefault(require("../Utils"));
|
|
11
|
+
|
|
12
|
+
var _Observable = _interopRequireDefault(require("../event/Observable"));
|
|
13
|
+
|
|
14
|
+
var _Layout = require("./layout/Layout");
|
|
15
|
+
|
|
16
|
+
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
17
|
+
|
|
18
|
+
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
|
|
19
|
+
|
|
20
|
+
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
25
|
+
|
|
26
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
27
|
+
|
|
28
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
29
|
+
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
+
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
|
|
36
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
37
|
+
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
+
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
42
|
+
const Dialog = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
43
|
+
const _React$useState = _react.default.useState({}),
|
|
44
|
+
_React$useState2 = _slicedToArray(_React$useState, 1),
|
|
45
|
+
layoutHandle = _React$useState2[0];
|
|
46
|
+
|
|
47
|
+
const _React$useState3 = _react.default.useState({}),
|
|
48
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
49
|
+
model = _React$useState4[0];
|
|
50
|
+
|
|
51
|
+
const _React$useState5 = _react.default.useState([]),
|
|
52
|
+
_React$useState6 = _slicedToArray(_React$useState5, 1),
|
|
53
|
+
loadedComponents = _React$useState6[0];
|
|
54
|
+
|
|
55
|
+
const _React$useState7 = _react.default.useState(true),
|
|
56
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
57
|
+
initializing = _React$useState8[0],
|
|
58
|
+
setInitializing = _React$useState8[1];
|
|
59
|
+
|
|
60
|
+
const _React$useState9 = _react.default.useState(false),
|
|
61
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
62
|
+
open = _React$useState10[0],
|
|
63
|
+
setOpen = _React$useState10[1];
|
|
64
|
+
|
|
65
|
+
const _React$useState11 = _react.default.useState(_Utils.default.getComponentAttribute(props.config, 'title', null)),
|
|
66
|
+
_React$useState12 = _slicedToArray(_React$useState11, 1),
|
|
67
|
+
title = _React$useState12[0];
|
|
68
|
+
|
|
69
|
+
_react.default.useEffect(() => {
|
|
70
|
+
props.handle.api = api();
|
|
71
|
+
|
|
72
|
+
if (initializing) {
|
|
73
|
+
if (_Utils.default.isNull(props.config.layout.id)) {
|
|
74
|
+
props.config.layout.id = props.config.id + '_layout';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let parsedConfig = _Utils.default.parseConfig(props.config, props.config.id);
|
|
78
|
+
|
|
79
|
+
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.config.id);
|
|
80
|
+
|
|
81
|
+
_Observable.default.addSystemSubscriptions(parsedConfig);
|
|
82
|
+
|
|
83
|
+
setInitializing(false);
|
|
84
|
+
loadCompleteHandler(props.config.id);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
function doUpdateModel(values) {
|
|
89
|
+
if (!_Utils.default.isNull(values)) {
|
|
90
|
+
for (let i = 0; i < values.length; i++) {
|
|
91
|
+
let value = values[i];
|
|
92
|
+
model[value.name] = value.value;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
_Observable.default.processSystemGeneratedSubscriptions(props.config.id);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
_react.default.useEffect(() => {
|
|
100
|
+
doUpdateModel(props.parameters);
|
|
101
|
+
}, [props.parameters]);
|
|
102
|
+
|
|
103
|
+
function loadCompleteHandler(_x) {
|
|
104
|
+
return _loadCompleteHandler.apply(this, arguments);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function _loadCompleteHandler() {
|
|
108
|
+
_loadCompleteHandler = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(id) {
|
|
109
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
110
|
+
while (1) switch (_context.prev = _context.next) {
|
|
111
|
+
case 0:
|
|
112
|
+
loadedComponents.push(id);
|
|
113
|
+
|
|
114
|
+
if (loadedComponents.includes(props.config.id)) {
|
|
115
|
+
props.loadCompleteHandler(props.config.id);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
case 2:
|
|
119
|
+
case "end":
|
|
120
|
+
return _context.stop();
|
|
121
|
+
}
|
|
122
|
+
}, _callee);
|
|
123
|
+
}));
|
|
124
|
+
return _loadCompleteHandler.apply(this, arguments);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const createLayoutHandle = (layout, api) => {
|
|
128
|
+
layoutHandle.api = api;
|
|
129
|
+
return layoutHandle;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
function render(layout) {
|
|
133
|
+
return /*#__PURE__*/_react.default.createElement(_Layout.Layout, {
|
|
134
|
+
ref: /*#__PURE__*/_react.default.createRef(),
|
|
135
|
+
handleFactory: (layout, api) => {
|
|
136
|
+
createLayoutHandle(layout, api);
|
|
137
|
+
},
|
|
138
|
+
config: layout,
|
|
139
|
+
viewId: props.viewId,
|
|
140
|
+
loadCompleteHandler: loadCompleteHandler,
|
|
141
|
+
parent: true
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const api = () => {
|
|
146
|
+
return {
|
|
147
|
+
get id() {
|
|
148
|
+
return props.config.id;
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
get model() {
|
|
152
|
+
let children = layoutHandle.api.getChildren();
|
|
153
|
+
|
|
154
|
+
var _iterator = _createForOfIteratorHelper(children),
|
|
155
|
+
_step;
|
|
156
|
+
|
|
157
|
+
try {
|
|
158
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
159
|
+
const child = _step.value;
|
|
160
|
+
|
|
161
|
+
if (!_Utils.default.isNull(child.api)) {
|
|
162
|
+
let valueGetter = !_Utils.default.isNull(child.api.model) ? child.api.model : !_Utils.default.isNull(child.api.getValue) ? child.api.getValue : child.api.value;
|
|
163
|
+
|
|
164
|
+
if (!_Utils.default.isNull(valueGetter)) {
|
|
165
|
+
model[child.api.id] = typeof valueGetter === 'function' ? valueGetter() : valueGetter;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
} catch (err) {
|
|
170
|
+
_iterator.e(err);
|
|
171
|
+
} finally {
|
|
172
|
+
_iterator.f();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return model;
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
open: () => {
|
|
179
|
+
setOpen(true);
|
|
180
|
+
},
|
|
181
|
+
close: () => {
|
|
182
|
+
setOpen(false);
|
|
183
|
+
},
|
|
184
|
+
getChild: id => {
|
|
185
|
+
if (id === layoutHandle.api.id) {
|
|
186
|
+
return layoutHandle;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
let children = layoutHandle.api.getChildren();
|
|
190
|
+
|
|
191
|
+
var _iterator2 = _createForOfIteratorHelper(children),
|
|
192
|
+
_step2;
|
|
193
|
+
|
|
194
|
+
try {
|
|
195
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
196
|
+
const child = _step2.value;
|
|
197
|
+
|
|
198
|
+
if (!_Utils.default.isNull(child.api) && id === child.api.id) {
|
|
199
|
+
return child;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
} catch (err) {
|
|
203
|
+
_iterator2.e(err);
|
|
204
|
+
} finally {
|
|
205
|
+
_iterator2.f();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return null;
|
|
209
|
+
},
|
|
210
|
+
getChildren: () => {
|
|
211
|
+
let children = [];
|
|
212
|
+
children.push(layoutHandle);
|
|
213
|
+
|
|
214
|
+
if (!_Utils.default.isNull(layoutHandle.api)) {
|
|
215
|
+
var _iterator3 = _createForOfIteratorHelper(layoutHandle.api.getChildren()),
|
|
216
|
+
_step3;
|
|
217
|
+
|
|
218
|
+
try {
|
|
219
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
220
|
+
const child = _step3.value;
|
|
221
|
+
children.push(child);
|
|
222
|
+
}
|
|
223
|
+
} catch (err) {
|
|
224
|
+
_iterator3.e(err);
|
|
225
|
+
} finally {
|
|
226
|
+
_iterator3.f();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return children;
|
|
231
|
+
},
|
|
232
|
+
updateModel: values => {
|
|
233
|
+
doUpdateModel(values);
|
|
234
|
+
},
|
|
235
|
+
setModelValue: (key, value) => {
|
|
236
|
+
model.key = value;
|
|
237
|
+
},
|
|
238
|
+
getModelValue: key => {
|
|
239
|
+
return model[key];
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, initializing === false ? /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
245
|
+
open: open,
|
|
246
|
+
maxWidth: "xl",
|
|
247
|
+
"aria-labelledby": "alert-dialog-title",
|
|
248
|
+
"aria-describedby": "alert-dialog-description"
|
|
249
|
+
}, !_Utils.default.isNull(title) ? /*#__PURE__*/_react.default.createElement(_DialogTitle.default, {
|
|
250
|
+
id: "alert-dialog-title"
|
|
251
|
+
}, title) : null, /*#__PURE__*/_react.default.createElement(_DialogContent.default, null, render(props.config.layout))) : null);
|
|
252
|
+
}), () => {
|
|
253
|
+
return true;
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
exports.Dialog = Dialog;
|
|
257
|
+
var _default = Dialog;
|
|
258
|
+
exports.default = _default;
|
package/dist/components/Graph.js
CHANGED
|
@@ -62,32 +62,36 @@ class Graph {
|
|
|
62
62
|
_defineProperty(this, "signal", event => {
|
|
63
63
|
let nextNodeName = this.current.getNextNode(event);
|
|
64
64
|
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
if (this.current.config.last && nextNodeName === null) {
|
|
66
|
+
_ApplicationContext.default.removeLoadedGraph();
|
|
67
|
+
} else {
|
|
68
|
+
if (!_Utils.default.isNull(nextNodeName)) {
|
|
69
|
+
var _iterator2 = _createForOfIteratorHelper(this.config.nodes),
|
|
70
|
+
_step2;
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
try {
|
|
73
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
74
|
+
const node = _step2.value;
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
if (node.name === nextNodeName) {
|
|
77
|
+
this.current = new _GraphNode.default(node);
|
|
78
|
+
this.addNodeToPath(this.current);
|
|
76
79
|
|
|
77
|
-
|
|
80
|
+
_ActionHandlers.default.invokeHandler(node.action, null, null, this.config.id);
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
80
84
|
}
|
|
85
|
+
} catch (err) {
|
|
86
|
+
_iterator2.e(err);
|
|
87
|
+
} finally {
|
|
88
|
+
_iterator2.f();
|
|
81
89
|
}
|
|
82
|
-
} catch (err) {
|
|
83
|
-
_iterator2.e(err);
|
|
84
|
-
} finally {
|
|
85
|
-
_iterator2.f();
|
|
86
90
|
}
|
|
87
|
-
}
|
|
88
91
|
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
if (this.current === null) {
|
|
93
|
+
console.error("Node name could not be found : " + nextNodeName);
|
|
94
|
+
}
|
|
91
95
|
}
|
|
92
96
|
});
|
|
93
97
|
|
|
@@ -184,6 +188,10 @@ class Graph {
|
|
|
184
188
|
return this.modelData;
|
|
185
189
|
}
|
|
186
190
|
|
|
191
|
+
set model(model) {
|
|
192
|
+
this.modelData = model;
|
|
193
|
+
}
|
|
194
|
+
|
|
187
195
|
get id() {
|
|
188
196
|
return this.config.id;
|
|
189
197
|
}
|
|
@@ -13,6 +13,10 @@ var _reactHtmlRenderer = _interopRequireDefault(require("react-html-renderer"));
|
|
|
13
13
|
|
|
14
14
|
var _Observable = _interopRequireDefault(require("../event/Observable"));
|
|
15
15
|
|
|
16
|
+
var _ApplicationContext = _interopRequireDefault(require("../ApplicationContext"));
|
|
17
|
+
|
|
18
|
+
var _reactPromiseTracker = require("react-promise-tracker");
|
|
19
|
+
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
21
|
|
|
18
22
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -27,12 +31,50 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
27
31
|
|
|
28
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
33
|
|
|
34
|
+
const Handlebars = require("handlebars");
|
|
35
|
+
|
|
36
|
+
const status = response => {
|
|
37
|
+
if (response.ok) {
|
|
38
|
+
return Promise.resolve(response);
|
|
39
|
+
} else {
|
|
40
|
+
let error = new Error(response.statusText);
|
|
41
|
+
error.code = response.status;
|
|
42
|
+
return Promise.reject(error);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const json = response => {
|
|
47
|
+
return response.text();
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const location = window.location.protocol + "//" + window.location.hostname + ":" + window.location.port;
|
|
51
|
+
|
|
30
52
|
const HtmlPanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
31
53
|
const _React$useState = _react.default.useState(true),
|
|
32
54
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
33
55
|
initializing = _React$useState2[0],
|
|
34
56
|
setInitializing = _React$useState2[1];
|
|
35
57
|
|
|
58
|
+
const _React$useState3 = _react.default.useState(null),
|
|
59
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
60
|
+
template = _React$useState4[0],
|
|
61
|
+
setTemplate = _React$useState4[1];
|
|
62
|
+
|
|
63
|
+
const _React$useState5 = _react.default.useState(null),
|
|
64
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
65
|
+
content = _React$useState6[0],
|
|
66
|
+
setContent = _React$useState6[1];
|
|
67
|
+
|
|
68
|
+
const _React$useState7 = _react.default.useState(null),
|
|
69
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
70
|
+
model = _React$useState8[0],
|
|
71
|
+
setModel = _React$useState8[1];
|
|
72
|
+
|
|
73
|
+
const _React$useState9 = _react.default.useState(_Utils.default.getComponentAttribute(props.config, 'defaultVisibility', false)),
|
|
74
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
75
|
+
visible = _React$useState10[0],
|
|
76
|
+
setVisible = _React$useState10[1];
|
|
77
|
+
|
|
36
78
|
_react.default.useEffect(() => {
|
|
37
79
|
props.handle.api = api();
|
|
38
80
|
|
|
@@ -48,6 +90,41 @@ const HtmlPanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.
|
|
|
48
90
|
if (!_Utils.default.isNull(props.loadCompleteHandler)) {
|
|
49
91
|
props.loadCompleteHandler(props.config.id);
|
|
50
92
|
}
|
|
93
|
+
|
|
94
|
+
let configTemplate = props.config.template;
|
|
95
|
+
|
|
96
|
+
if (configTemplate && configTemplate.endsWith('.html')) {
|
|
97
|
+
let fetchConfig = {
|
|
98
|
+
method: 'GET'
|
|
99
|
+
};
|
|
100
|
+
(0, _reactPromiseTracker.trackPromise)(fetch(encodeURI(location + configTemplate), fetchConfig).then(status).then(json).then(data => {
|
|
101
|
+
setTemplate(data);
|
|
102
|
+
}).catch(e => {
|
|
103
|
+
console.error(e);
|
|
104
|
+
}));
|
|
105
|
+
} else {
|
|
106
|
+
setTemplate(configTemplate); // TODO : Process template
|
|
107
|
+
|
|
108
|
+
setContent(configTemplate);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
Handlebars.registerHelper({
|
|
112
|
+
eq: (v1, v2) => v1 === v2,
|
|
113
|
+
ne: (v1, v2) => v1 !== v2,
|
|
114
|
+
lt: (v1, v2) => v1 < v2,
|
|
115
|
+
gt: (v1, v2) => v1 > v2,
|
|
116
|
+
lte: (v1, v2) => v1 <= v2,
|
|
117
|
+
gte: (v1, v2) => v1 >= v2,
|
|
118
|
+
|
|
119
|
+
and() {
|
|
120
|
+
return Array.prototype.every.call(arguments, Boolean);
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
or() {
|
|
124
|
+
return Array.prototype.slice.call(arguments, 0, -1).some(Boolean);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
});
|
|
51
128
|
}
|
|
52
129
|
});
|
|
53
130
|
|
|
@@ -57,14 +134,36 @@ const HtmlPanel = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.
|
|
|
57
134
|
return props.config.id;
|
|
58
135
|
},
|
|
59
136
|
|
|
60
|
-
loadData: actionConfig => {
|
|
137
|
+
loadData: actionConfig => {
|
|
138
|
+
if (actionConfig && actionConfig.value) {
|
|
139
|
+
let data = _ApplicationContext.default.resolveExpressionValue(actionConfig.value);
|
|
140
|
+
|
|
141
|
+
let templateScript = Handlebars.compile(template);
|
|
142
|
+
setContent(templateScript(data.map ? data.map : data));
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
refresh() {
|
|
147
|
+
if (!_Utils.default.isNull(props.config) && !_Utils.default.isNull(props.config.visible)) {
|
|
148
|
+
setVisible(_Utils.default.evaluateBooleanExpression(props.config.visible, props.config.id));
|
|
149
|
+
} else {
|
|
150
|
+
setVisible(true);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
getChildren: () => {
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
61
157
|
};
|
|
62
158
|
};
|
|
63
159
|
|
|
64
160
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
-
ref: ref
|
|
66
|
-
|
|
67
|
-
|
|
161
|
+
ref: ref,
|
|
162
|
+
style: {
|
|
163
|
+
display: visible ? 'block' : 'none'
|
|
164
|
+
}
|
|
165
|
+
}, !_Utils.default.isNull(props.config) && content ? /*#__PURE__*/_react.default.createElement(_reactHtmlRenderer.default, {
|
|
166
|
+
html: content
|
|
68
167
|
}) : null);
|
|
69
168
|
}));
|
|
70
169
|
|
package/dist/components/Icon.js
CHANGED
|
@@ -23,6 +23,28 @@ var _Error = _interopRequireDefault(require("@material-ui/icons/Error"));
|
|
|
23
23
|
|
|
24
24
|
var _CloudDownload = _interopRequireDefault(require("@material-ui/icons/CloudDownload"));
|
|
25
25
|
|
|
26
|
+
var _CloudUpload = _interopRequireDefault(require("@material-ui/icons/CloudUpload"));
|
|
27
|
+
|
|
28
|
+
var _RotateLeft = _interopRequireDefault(require("@material-ui/icons/RotateLeft"));
|
|
29
|
+
|
|
30
|
+
var _RotateRight = _interopRequireDefault(require("@material-ui/icons/RotateRight"));
|
|
31
|
+
|
|
32
|
+
var _ZoomIn = _interopRequireDefault(require("@material-ui/icons/ZoomIn"));
|
|
33
|
+
|
|
34
|
+
var _ZoomOut = _interopRequireDefault(require("@material-ui/icons/ZoomOut"));
|
|
35
|
+
|
|
36
|
+
var _Work = _interopRequireDefault(require("@material-ui/icons/Work"));
|
|
37
|
+
|
|
38
|
+
var _Home = _interopRequireDefault(require("@material-ui/icons/Home"));
|
|
39
|
+
|
|
40
|
+
var _List = _interopRequireDefault(require("@material-ui/icons/List"));
|
|
41
|
+
|
|
42
|
+
var _Notifications = _interopRequireDefault(require("@material-ui/icons/Notifications"));
|
|
43
|
+
|
|
44
|
+
var _Person = _interopRequireDefault(require("@material-ui/icons/Person"));
|
|
45
|
+
|
|
46
|
+
var _Folder = _interopRequireDefault(require("@material-ui/icons/Folder"));
|
|
47
|
+
|
|
26
48
|
var _react = _interopRequireWildcard(require("react"));
|
|
27
49
|
|
|
28
50
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
@@ -53,6 +75,42 @@ class Icon extends _react.Component {
|
|
|
53
75
|
return /*#__PURE__*/_react.default.createElement(_CloudDownload.default, null);
|
|
54
76
|
} else if (this.props.id === 'SEARCH') {
|
|
55
77
|
return /*#__PURE__*/_react.default.createElement(_Search.default, null);
|
|
78
|
+
} else if (this.props.id === 'WORK') {
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement(_Work.default, null);
|
|
80
|
+
} else if (this.props.id === 'NOTIFICATIONS') {
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement(_Notifications.default, null);
|
|
82
|
+
} else if (this.props.id === 'HOME') {
|
|
83
|
+
return /*#__PURE__*/_react.default.createElement(_Home.default, null);
|
|
84
|
+
} else if (this.props.id === 'LIST') {
|
|
85
|
+
return /*#__PURE__*/_react.default.createElement(_List.default, null);
|
|
86
|
+
} else if (this.props.id === 'UPLOAD') {
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(_CloudUpload.default, null);
|
|
88
|
+
} else if (this.props.id === 'ROTATE_LEFT') {
|
|
89
|
+
return /*#__PURE__*/_react.default.createElement(_RotateLeft.default, null);
|
|
90
|
+
} else if (this.props.id === 'ROTATE_RIGHT') {
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement(_RotateRight.default, null);
|
|
92
|
+
} else if (this.props.id === 'ZOOM_IN') {
|
|
93
|
+
return /*#__PURE__*/_react.default.createElement(_ZoomIn.default, null);
|
|
94
|
+
} else if (this.props.id === 'ZOOM_OUT') {
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement(_ZoomOut.default, null);
|
|
96
|
+
} else if (this.props.id === 'PERSON') {
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement(_Person.default, null);
|
|
98
|
+
} else if (this.props.id === 'INITIAL') {
|
|
99
|
+
return /*#__PURE__*/_react.default.createElement("i", {
|
|
100
|
+
className: "fas fa-signature",
|
|
101
|
+
style: {
|
|
102
|
+
color: this.props.color
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
} else if (this.props.id === 'FOLDER') {
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(_Folder.default, null);
|
|
107
|
+
} else if (this.props.id === 'SIGN') {
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement("i", {
|
|
109
|
+
className: "fas fa-pen-nib",
|
|
110
|
+
style: {
|
|
111
|
+
color: this.props.color
|
|
112
|
+
}
|
|
113
|
+
});
|
|
56
114
|
} else if (this.props.id === 'ERROR') {
|
|
57
115
|
return /*#__PURE__*/_react.default.createElement(_Error.default, {
|
|
58
116
|
style: {
|
|
@@ -60,6 +118,8 @@ class Icon extends _react.Component {
|
|
|
60
118
|
}
|
|
61
119
|
});
|
|
62
120
|
}
|
|
121
|
+
|
|
122
|
+
return null;
|
|
63
123
|
}
|
|
64
124
|
|
|
65
125
|
}
|
|
@@ -11,8 +11,6 @@ var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
|
11
11
|
|
|
12
12
|
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
|
|
13
13
|
|
|
14
|
-
var _DialogContentText = _interopRequireDefault(require("@material-ui/core/DialogContentText"));
|
|
15
|
-
|
|
16
14
|
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
|
|
17
15
|
|
|
18
16
|
var _Utils = _interopRequireDefault(require("../Utils"));
|
|
@@ -21,9 +19,28 @@ var _styles = require("@material-ui/core/styles");
|
|
|
21
19
|
|
|
22
20
|
var _View = require("./layout/View");
|
|
23
21
|
|
|
22
|
+
var _DynamicJS = _interopRequireDefault(require("../DynamicJS"));
|
|
23
|
+
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
-
function
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
|
|
30
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
+
|
|
32
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
33
|
+
|
|
34
|
+
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
function PopupViewDialog(props) {
|
|
39
|
+
const _React$useState = _react.default.useState(""),
|
|
40
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
41
|
+
title = _React$useState2[0],
|
|
42
|
+
setTitle = _React$useState2[1];
|
|
43
|
+
|
|
27
44
|
const height = _Utils.default.getComponentAttribute(props.view.config, 'height', '28vh');
|
|
28
45
|
|
|
29
46
|
const width = _Utils.default.getComponentAttribute(props.view.config, 'width', '40vw');
|
|
@@ -46,15 +63,47 @@ function PopupView(props) {
|
|
|
46
63
|
classes: {
|
|
47
64
|
paper: classes.dialogPaper
|
|
48
65
|
},
|
|
49
|
-
open: props.
|
|
66
|
+
open: props.view !== null,
|
|
50
67
|
"aria-labelledby": "alert-dialog-title",
|
|
51
68
|
"aria-describedby": "alert-dialog-description"
|
|
52
69
|
}, /*#__PURE__*/_react.default.createElement(_DialogTitle.default, {
|
|
53
70
|
id: "alert-dialog-title"
|
|
54
|
-
},
|
|
71
|
+
}, title), /*#__PURE__*/_react.default.createElement(_DialogContent.default, {
|
|
72
|
+
style: {
|
|
73
|
+
overflow: "hidden"
|
|
74
|
+
}
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_View.View, {
|
|
55
76
|
config: props.view.config,
|
|
56
77
|
parameters: props.view.parameters,
|
|
57
78
|
ref: props.view.ref,
|
|
58
|
-
handle: props.view.handle
|
|
79
|
+
handle: props.view.handle,
|
|
80
|
+
loadCallback: () => {
|
|
81
|
+
setTitle(_DynamicJS.default.executeScript("popupTitle_".concat(props.view.id), props.view.config.title, props.view.id));
|
|
82
|
+
}
|
|
59
83
|
})));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @return {null}
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
function PopupView(props) {
|
|
91
|
+
const _React$useState3 = _react.default.useState(null),
|
|
92
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
93
|
+
view = _React$useState4[0],
|
|
94
|
+
setView = _React$useState4[1];
|
|
95
|
+
|
|
96
|
+
_react.default.useEffect(() => {
|
|
97
|
+
props.controller.open = view => {
|
|
98
|
+
setView(view);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
props.controller.close = () => {
|
|
102
|
+
setView(null);
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
return view !== null ? /*#__PURE__*/_react.default.createElement(PopupViewDialog, {
|
|
107
|
+
view: view
|
|
108
|
+
}) : null;
|
|
60
109
|
}
|