@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
|
@@ -29,6 +29,10 @@ var _EventType = _interopRequireDefault(require("../../event/EventType"));
|
|
|
29
29
|
|
|
30
30
|
var Base64 = _interopRequireWildcard(require("js-base64"));
|
|
31
31
|
|
|
32
|
+
var _RestUtils = require("../../RestUtils");
|
|
33
|
+
|
|
34
|
+
var _ServiceCallActionHandler = _interopRequireDefault(require("../../event/ServiceCallActionHandler"));
|
|
35
|
+
|
|
32
36
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
33
37
|
|
|
34
38
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -67,6 +71,7 @@ const TEXT_ITEM = {
|
|
|
67
71
|
defaultWidthOnPageDrop: "200px",
|
|
68
72
|
defaultHeightOnPageDrop: "80px"
|
|
69
73
|
};
|
|
74
|
+
const DROP_ITEM_MARGIN = 32;
|
|
70
75
|
const types = [INITIAL_ITEM, SIGN_ITEM, TEXT_ITEM];
|
|
71
76
|
const useStyles = (0, _core.makeStyles)(theme => ({
|
|
72
77
|
button: {
|
|
@@ -79,14 +84,15 @@ const useStyles = (0, _core.makeStyles)(theme => ({
|
|
|
79
84
|
color: 'red'
|
|
80
85
|
},
|
|
81
86
|
propertyWindow: {
|
|
82
|
-
width: "320px",
|
|
83
87
|
height: "400px",
|
|
84
|
-
border: "1px solid #e1e1e1",
|
|
85
88
|
margin: "4px",
|
|
86
|
-
borderRadius: "4px"
|
|
89
|
+
borderRadius: "4px",
|
|
90
|
+
paddingLeft: "24px",
|
|
91
|
+
borderBottom: "1px solid #e1e1e1",
|
|
92
|
+
borderTop: "1px solid #e1e1e1"
|
|
87
93
|
},
|
|
88
94
|
paletteButton: {
|
|
89
|
-
width: "
|
|
95
|
+
width: "270px",
|
|
90
96
|
height: "40px",
|
|
91
97
|
backgroundColor: "#e1e1e1",
|
|
92
98
|
margin: "4px",
|
|
@@ -98,7 +104,7 @@ const useStyles = (0, _core.makeStyles)(theme => ({
|
|
|
98
104
|
'&:hover': {
|
|
99
105
|
backgroundColor: "yellowgreen"
|
|
100
106
|
},
|
|
101
|
-
width: "
|
|
107
|
+
width: "270px",
|
|
102
108
|
height: "40px",
|
|
103
109
|
backgroundColor: "yellowgreen",
|
|
104
110
|
margin: "4px",
|
|
@@ -107,7 +113,7 @@ const useStyles = (0, _core.makeStyles)(theme => ({
|
|
|
107
113
|
borderRadius: "4px"
|
|
108
114
|
},
|
|
109
115
|
palette: {
|
|
110
|
-
width: "
|
|
116
|
+
width: "280px",
|
|
111
117
|
borderRadius: "4px",
|
|
112
118
|
border: "1px solid #e1e1e1"
|
|
113
119
|
}
|
|
@@ -179,6 +185,8 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
179
185
|
loading = _React$useState16[0],
|
|
180
186
|
setLoading = _React$useState16[1];
|
|
181
187
|
|
|
188
|
+
const documentName = _react.default.useRef(null);
|
|
189
|
+
|
|
182
190
|
_react.default.useEffect(() => {
|
|
183
191
|
props.handle.api = api();
|
|
184
192
|
|
|
@@ -197,6 +205,12 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
197
205
|
}
|
|
198
206
|
});
|
|
199
207
|
|
|
208
|
+
_react.default.useEffect(() => {
|
|
209
|
+
if (!_Utils.default.isNull(props.valueChangeHandler)) {
|
|
210
|
+
props.valueChangeHandler(value);
|
|
211
|
+
}
|
|
212
|
+
}, [value]);
|
|
213
|
+
|
|
200
214
|
const api = () => {
|
|
201
215
|
return {
|
|
202
216
|
get id() {
|
|
@@ -205,19 +219,47 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
205
219
|
|
|
206
220
|
loadData: actionConfig => {
|
|
207
221
|
setLoading(true);
|
|
222
|
+
let service = !_Utils.default.isNull(props.config.dataService) ? props.config.dataService : !_Utils.default.isNull(actionConfig) !== null ? actionConfig.dataService : null;
|
|
223
|
+
|
|
224
|
+
if (!_Utils.default.isNull(service)) {
|
|
225
|
+
if (service.type === 'remoteObjectProxy') {
|
|
226
|
+
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId, result => {
|
|
227
|
+
setLoading(false);
|
|
228
|
+
}, e => {
|
|
229
|
+
console.error(e);
|
|
230
|
+
|
|
231
|
+
_Utils.default.publishSystemErrorMessage(props.viewId);
|
|
232
|
+
}, parameter => {
|
|
233
|
+
setLoading(false);
|
|
234
|
+
});
|
|
235
|
+
} else {
|
|
236
|
+
if (_Utils.default.isNull(actionConfig)) {
|
|
237
|
+
actionConfig = {};
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
actionConfig.service = service;
|
|
241
|
+
|
|
242
|
+
_ServiceCallActionHandler.default.execute(actionConfig, null, null, props.viewId, data => {
|
|
243
|
+
setHtmlTemplate(data.template);
|
|
244
|
+
setLoading(false);
|
|
245
|
+
}, () => {});
|
|
246
|
+
}
|
|
208
247
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
248
|
+
return true;
|
|
249
|
+
} else {
|
|
250
|
+
if (!_Utils.default.isNull(actionConfig) && !_Utils.default.isNull(actionConfig.value)) {
|
|
251
|
+
let value = _ApplicationContext.default.isExpression(actionConfig.value) ? _ApplicationContext.default.resolveExpressionValue(actionConfig.value) : actionConfig.value;
|
|
213
252
|
setValue(value);
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
253
|
+
|
|
254
|
+
if (!_Utils.default.isNull(value)) {
|
|
255
|
+
setHtmlTemplate(value.htmlTemplate);
|
|
256
|
+
setInputBoxValues(value.signatureInputs);
|
|
257
|
+
idCounter.current = value.idCounter;
|
|
258
|
+
}
|
|
217
259
|
}
|
|
218
|
-
}
|
|
219
260
|
|
|
220
|
-
|
|
261
|
+
setLoading(false);
|
|
262
|
+
}
|
|
221
263
|
},
|
|
222
264
|
|
|
223
265
|
get model() {
|
|
@@ -319,9 +361,9 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
319
361
|
left = parseFloat(element.style.left.replace('px', '')) + 4;
|
|
320
362
|
}
|
|
321
363
|
|
|
322
|
-
if (parseFloat(element.style.top.replace('
|
|
364
|
+
if (parseFloat(element.style.top.replace('px', '')) === top) {
|
|
323
365
|
topOffset += 4;
|
|
324
|
-
top = parseFloat(element.style.top.replace('
|
|
366
|
+
top = parseFloat(element.style.top.replace('px', ''));
|
|
325
367
|
}
|
|
326
368
|
}
|
|
327
369
|
} catch (err) {
|
|
@@ -369,18 +411,18 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
369
411
|
|
|
370
412
|
if (event.target.className.includes("page")) {
|
|
371
413
|
let top = !_Utils.default.isNull(event.target.style.top) && event.target.style.top.trim().length > 0 ? event.target.style.top.replaceAll('pt', '') : '0';
|
|
372
|
-
let topPos = parseFloat(top) + parseFloat(event.target.style.height.replace('pt', '')) - 75;
|
|
373
|
-
let pageDropOffset = getPageDropOffset(
|
|
374
|
-
node.style.top = topPos - pageDropOffset.topOffset + 'pt';
|
|
414
|
+
let topPos = parseFloat(top) + parseFloat(event.target.style.height.replace('pt', '')) - parseFloat(paletteSelection.current.defaultHeightOnPageDrop.replace('px', '')) * .75 - DROP_ITEM_MARGIN;
|
|
415
|
+
let pageDropOffset = getPageDropOffset(DROP_ITEM_MARGIN, parseFloat(convertToPixels(topPos + "pt").replace('px', '')));
|
|
416
|
+
node.style.top = convertToPixels(topPos - pageDropOffset.topOffset + 'pt');
|
|
375
417
|
node.style.width = paletteSelection.current.defaultWidthOnPageDrop;
|
|
376
418
|
node.style.height = paletteSelection.current.defaultHeightOnPageDrop;
|
|
377
419
|
node.style.padding = '8px';
|
|
378
|
-
node.style.left =
|
|
420
|
+
node.style.left = DROP_ITEM_MARGIN + pageDropOffset.leftOffset + 'px';
|
|
379
421
|
event.target.appendChild(node);
|
|
380
422
|
} else {
|
|
381
423
|
let lineHeight = event.target.style.lineHeight;
|
|
382
424
|
let hasLineHeight = !_Utils.default.isNull(lineHeight) && lineHeight.trim().length > 0 && lineHeight.toString() !== '0';
|
|
383
|
-
node.style.top = hasLineHeight ? event.target.style.top : parseFloat(event.target.style.top.replace('pt', '')) - 14.5 + 'pt';
|
|
425
|
+
node.style.top = hasLineHeight ? event.target.style.top : convertToPixels(parseFloat(event.target.style.top.replace('pt', '')) - 14.5 + 'pt');
|
|
384
426
|
node.style.left = event.target.style.left;
|
|
385
427
|
node.style.width = convertToPixels(event.target.style.width);
|
|
386
428
|
node.style.height = convertToPixels(hasLineHeight ? event.target.style.lineHeight : '14.5pt');
|
|
@@ -426,27 +468,29 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
426
468
|
}, [value]);
|
|
427
469
|
|
|
428
470
|
const initDragAndDrop = className => {
|
|
429
|
-
|
|
471
|
+
setTimeout(() => {
|
|
472
|
+
let elements = document.getElementsByClassName(className);
|
|
430
473
|
|
|
431
|
-
|
|
432
|
-
|
|
474
|
+
var _iterator5 = _createForOfIteratorHelper(elements),
|
|
475
|
+
_step5;
|
|
433
476
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
477
|
+
try {
|
|
478
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
479
|
+
const element = _step5.value;
|
|
437
480
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
481
|
+
if (className !== "page") {
|
|
482
|
+
element.addEventListener("dragstart", dragStart, false);
|
|
483
|
+
}
|
|
441
484
|
|
|
442
|
-
|
|
443
|
-
|
|
485
|
+
element.addEventListener("dragover", dragOver, false);
|
|
486
|
+
element.addEventListener("drop", drop, false);
|
|
487
|
+
}
|
|
488
|
+
} catch (err) {
|
|
489
|
+
_iterator5.e(err);
|
|
490
|
+
} finally {
|
|
491
|
+
_iterator5.f();
|
|
444
492
|
}
|
|
445
|
-
}
|
|
446
|
-
_iterator5.e(err);
|
|
447
|
-
} finally {
|
|
448
|
-
_iterator5.f();
|
|
449
|
-
}
|
|
493
|
+
}, 2000);
|
|
450
494
|
};
|
|
451
495
|
|
|
452
496
|
const destroyEvents = () => {
|
|
@@ -513,12 +557,75 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
513
557
|
setPaletteSelectionId(null);
|
|
514
558
|
}, [htmlTemplate]);
|
|
515
559
|
|
|
560
|
+
function getElementPage(elementId) {
|
|
561
|
+
let pages = document.getElementsByClassName("page");
|
|
562
|
+
|
|
563
|
+
var _iterator9 = _createForOfIteratorHelper(pages),
|
|
564
|
+
_step9;
|
|
565
|
+
|
|
566
|
+
try {
|
|
567
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
568
|
+
const page = _step9.value;
|
|
569
|
+
let elements = page.getElementsByClassName("__agm_wf_signatureInput__");
|
|
570
|
+
|
|
571
|
+
var _iterator10 = _createForOfIteratorHelper(elements),
|
|
572
|
+
_step10;
|
|
573
|
+
|
|
574
|
+
try {
|
|
575
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
576
|
+
const element = _step10.value;
|
|
577
|
+
|
|
578
|
+
if (element.id === elementId) {
|
|
579
|
+
return page;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
} catch (err) {
|
|
583
|
+
_iterator10.e(err);
|
|
584
|
+
} finally {
|
|
585
|
+
_iterator10.f();
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
} catch (err) {
|
|
589
|
+
_iterator9.e(err);
|
|
590
|
+
} finally {
|
|
591
|
+
_iterator9.f();
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
return null;
|
|
595
|
+
}
|
|
596
|
+
|
|
516
597
|
function handleDragDrop(event) {
|
|
517
598
|
let offset;
|
|
518
599
|
offset = dragAndDropData.offset.split(',');
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
600
|
+
let dm = document.getElementById(dragAndDropData.id);
|
|
601
|
+
let page = getElementPage(dm.id);
|
|
602
|
+
let itemLeft = event.clientX + parseInt(offset[0], 10);
|
|
603
|
+
let itemTop = event.clientY + parseInt(offset[1], 10);
|
|
604
|
+
let itemWidth = parseFloat(convertToPixels(dm.style.width).replace('px', ''));
|
|
605
|
+
let itemHeight = parseFloat(convertToPixels(dm.style.height).replace('px', ''));
|
|
606
|
+
dm.style.left = itemLeft + 'px';
|
|
607
|
+
dm.style.top = itemTop + 'px';
|
|
608
|
+
let itemRight = itemLeft + itemWidth;
|
|
609
|
+
let itemBottom = itemTop + itemHeight;
|
|
610
|
+
let pageRight = parseFloat(convertToPixels(page.style.width).replace('px', ''));
|
|
611
|
+
let pageBottom = parseFloat(convertToPixels(page.style.height).replace('px', ''));
|
|
612
|
+
|
|
613
|
+
if (itemLeft < DROP_ITEM_MARGIN) {
|
|
614
|
+
dm.style.left = DROP_ITEM_MARGIN + 'px';
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
if (itemRight > pageRight - DROP_ITEM_MARGIN) {
|
|
618
|
+
dm.style.left = pageRight - DROP_ITEM_MARGIN - itemWidth + 'px';
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
if (itemTop < DROP_ITEM_MARGIN) {
|
|
622
|
+
dm.style.top = DROP_ITEM_MARGIN + 'px';
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
if (itemBottom > pageBottom - DROP_ITEM_MARGIN) {
|
|
626
|
+
dm.style.top = pageBottom - DROP_ITEM_MARGIN - itemHeight + 'px';
|
|
627
|
+
}
|
|
628
|
+
|
|
522
629
|
event.preventDefault();
|
|
523
630
|
return false;
|
|
524
631
|
}
|
|
@@ -527,7 +634,6 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
527
634
|
document.body.style.cursor = "move";
|
|
528
635
|
let style = window.getComputedStyle(event.target, null);
|
|
529
636
|
dragAndDropData.offset = parseInt(style.getPropertyValue("left"), 10) - event.clientX + ',' + (parseInt(style.getPropertyValue("top"), 10) - event.clientY);
|
|
530
|
-
console.log("\n\n\nDRAG START " + event.target.id);
|
|
531
637
|
dragAndDropData.id = event.target.id;
|
|
532
638
|
}
|
|
533
639
|
|
|
@@ -544,12 +650,12 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
544
650
|
const getInputValue = id => {
|
|
545
651
|
let index = 0;
|
|
546
652
|
|
|
547
|
-
var
|
|
548
|
-
|
|
653
|
+
var _iterator11 = _createForOfIteratorHelper(inputBoxValues),
|
|
654
|
+
_step11;
|
|
549
655
|
|
|
550
656
|
try {
|
|
551
|
-
for (
|
|
552
|
-
const inputBoxValue =
|
|
657
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
658
|
+
const inputBoxValue = _step11.value;
|
|
553
659
|
|
|
554
660
|
if (inputBoxValue.id === id) {
|
|
555
661
|
inputBoxValue.index = index;
|
|
@@ -559,9 +665,9 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
559
665
|
index++;
|
|
560
666
|
}
|
|
561
667
|
} catch (err) {
|
|
562
|
-
|
|
668
|
+
_iterator11.e(err);
|
|
563
669
|
} finally {
|
|
564
|
-
|
|
670
|
+
_iterator11.f();
|
|
565
671
|
}
|
|
566
672
|
|
|
567
673
|
return null;
|
|
@@ -599,6 +705,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
599
705
|
|
|
600
706
|
const handleChange = () => event => {
|
|
601
707
|
let files = event.target.files;
|
|
708
|
+
documentName.current = files[0].name;
|
|
602
709
|
setFile(files[0]);
|
|
603
710
|
};
|
|
604
711
|
|
|
@@ -611,18 +718,18 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
611
718
|
};
|
|
612
719
|
|
|
613
720
|
const clear = () => {
|
|
614
|
-
var
|
|
615
|
-
|
|
721
|
+
var _iterator12 = _createForOfIteratorHelper(inputBoxValues),
|
|
722
|
+
_step12;
|
|
616
723
|
|
|
617
724
|
try {
|
|
618
|
-
for (
|
|
619
|
-
const inputBoxValue =
|
|
725
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
726
|
+
const inputBoxValue = _step12.value;
|
|
620
727
|
document.getElementById(inputBoxValue.id).remove();
|
|
621
728
|
}
|
|
622
729
|
} catch (err) {
|
|
623
|
-
|
|
730
|
+
_iterator12.e(err);
|
|
624
731
|
} finally {
|
|
625
|
-
|
|
732
|
+
_iterator12.f();
|
|
626
733
|
}
|
|
627
734
|
|
|
628
735
|
inputBoxValues.splice(0, inputBoxValues.length);
|
|
@@ -637,12 +744,12 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
637
744
|
let elementTop = 3 * parseFloat(element.style.top.replace("px", '').replace('pt', '')) / 4;
|
|
638
745
|
let pageElementTop = 0;
|
|
639
746
|
|
|
640
|
-
var
|
|
641
|
-
|
|
747
|
+
var _iterator13 = _createForOfIteratorHelper(pageElements),
|
|
748
|
+
_step13;
|
|
642
749
|
|
|
643
750
|
try {
|
|
644
|
-
for (
|
|
645
|
-
const pageElement =
|
|
751
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
752
|
+
const pageElement = _step13.value;
|
|
646
753
|
let pageElementHeight = parseFloat(pageElement.style.height.replace("px", '').replace('pt', ''));
|
|
647
754
|
|
|
648
755
|
if (elementTop >= pageElementTop && elementTop < pageElementTop + pageElementHeight) {
|
|
@@ -653,21 +760,21 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
653
760
|
pageElementTop += pageElementHeight;
|
|
654
761
|
}
|
|
655
762
|
} catch (err) {
|
|
656
|
-
|
|
763
|
+
_iterator13.e(err);
|
|
657
764
|
} finally {
|
|
658
|
-
|
|
765
|
+
_iterator13.f();
|
|
659
766
|
}
|
|
660
767
|
|
|
661
768
|
let offset = elementTop - pageElementTop;
|
|
662
769
|
let pageNumber = 0;
|
|
663
770
|
let elementData = getInputValue(id);
|
|
664
771
|
|
|
665
|
-
var
|
|
666
|
-
|
|
772
|
+
var _iterator14 = _createForOfIteratorHelper(pageElements),
|
|
773
|
+
_step14;
|
|
667
774
|
|
|
668
775
|
try {
|
|
669
|
-
for (
|
|
670
|
-
const pageElement =
|
|
776
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
777
|
+
const pageElement = _step14.value;
|
|
671
778
|
let pageElementHeight = parseFloat(pageElement.style.height.replace("px", '').replace('pt', ''));
|
|
672
779
|
|
|
673
780
|
if (pageElement !== elementPage) {
|
|
@@ -682,9 +789,10 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
682
789
|
node.style.height = element.style.height;
|
|
683
790
|
node.style.left = element.style.left;
|
|
684
791
|
node.innerText = element.innerText;
|
|
685
|
-
node.style.top = pageNumber * pageElementHeight + offset + 'pt';
|
|
792
|
+
node.style.top = convertToPixels(pageNumber * pageElementHeight + offset + 'pt');
|
|
686
793
|
node.id = idCounter.current++;
|
|
687
794
|
node.className = element.className;
|
|
795
|
+
node.setAttribute("sid", element.getAttribute("sid"));
|
|
688
796
|
node.setAttribute("draggable", true);
|
|
689
797
|
let inputValue = {};
|
|
690
798
|
inputValue.id = node.id;
|
|
@@ -693,27 +801,27 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
693
801
|
inputValue.type = elementData.type;
|
|
694
802
|
inputValue.signatory = elementData.signatory;
|
|
695
803
|
inputBoxValues.push(inputValue);
|
|
696
|
-
setValue(null);
|
|
697
804
|
pageElement.appendChild(node);
|
|
698
805
|
node.addEventListener('dragstart', dragStart, false);
|
|
806
|
+
saveValue();
|
|
699
807
|
}
|
|
700
808
|
}
|
|
701
809
|
} catch (err) {
|
|
702
|
-
|
|
810
|
+
_iterator14.e(err);
|
|
703
811
|
} finally {
|
|
704
|
-
|
|
812
|
+
_iterator14.f();
|
|
705
813
|
}
|
|
706
814
|
};
|
|
707
815
|
|
|
708
816
|
function saveValue() {
|
|
709
817
|
let allValid = true;
|
|
710
818
|
|
|
711
|
-
var
|
|
712
|
-
|
|
819
|
+
var _iterator15 = _createForOfIteratorHelper(inputBoxValues),
|
|
820
|
+
_step15;
|
|
713
821
|
|
|
714
822
|
try {
|
|
715
|
-
for (
|
|
716
|
-
const inputBoxValue =
|
|
823
|
+
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
|
824
|
+
const inputBoxValue = _step15.value;
|
|
717
825
|
|
|
718
826
|
if (_Utils.default.isNull(inputBoxValue.signatory)) {
|
|
719
827
|
allValid = false;
|
|
@@ -721,17 +829,18 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
721
829
|
}
|
|
722
830
|
}
|
|
723
831
|
} catch (err) {
|
|
724
|
-
|
|
832
|
+
_iterator15.e(err);
|
|
725
833
|
} finally {
|
|
726
|
-
|
|
834
|
+
_iterator15.f();
|
|
727
835
|
}
|
|
728
836
|
|
|
729
837
|
if (allValid) {
|
|
730
838
|
let newValue = {};
|
|
731
|
-
newValue.htmlTemplate = document.getElementById("templateContainer").innerHTML;
|
|
732
|
-
newValue.htmlTemplateBase64 = Base64.encode(
|
|
839
|
+
newValue.htmlTemplate = document.getElementById("templateContainer").innerHTML.replace("div name=\"replaced_html\"", "html").replace("div name=\"replaced_body\"", "body");
|
|
840
|
+
newValue.htmlTemplateBase64 = Base64.encode(newValue.htmlTemplate);
|
|
733
841
|
newValue.signatureInputs = inputBoxValues;
|
|
734
842
|
newValue.idCounter = idCounter.current;
|
|
843
|
+
newValue.documentName = documentName.current;
|
|
735
844
|
setValue(newValue);
|
|
736
845
|
} else {
|
|
737
846
|
setValue(null);
|
|
@@ -749,6 +858,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
749
858
|
element.style.height = values.height + "px";
|
|
750
859
|
element.style.borderColor = VALID_COLOR;
|
|
751
860
|
element.innerText = values.signatory.map.name;
|
|
861
|
+
element.setAttribute("sid", values.signatory.map.emailAddress);
|
|
752
862
|
saveValue();
|
|
753
863
|
};
|
|
754
864
|
|
|
@@ -762,7 +872,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
762
872
|
width: "100%",
|
|
763
873
|
maxHeight: "70vh"
|
|
764
874
|
}
|
|
765
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
875
|
+
}, _Utils.default.isNull(props.showToolbar) || props.showToolbar === true ? /*#__PURE__*/_react.default.createElement("div", {
|
|
766
876
|
style: {
|
|
767
877
|
marginBottom: "32px"
|
|
768
878
|
}
|
|
@@ -790,7 +900,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
790
900
|
disabled: _Utils.default.isNull(file),
|
|
791
901
|
className: classes.button,
|
|
792
902
|
onClick: handleSubmit()
|
|
793
|
-
}, "Generate Template"))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
903
|
+
}, "Generate Template"))))) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
794
904
|
style: {
|
|
795
905
|
height: "auto"
|
|
796
906
|
}
|
|
@@ -861,7 +971,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
861
971
|
"label": "paletteButtonLabel"
|
|
862
972
|
}
|
|
863
973
|
}, "Clear")), /*#__PURE__*/_react.default.createElement("div", {
|
|
864
|
-
className: "".concat(classes.propertyWindow
|
|
974
|
+
className: "".concat(classes.propertyWindow)
|
|
865
975
|
}, /*#__PURE__*/_react.default.createElement(_SignatureInputProps.default, {
|
|
866
976
|
value: selectedInputBoxValue,
|
|
867
977
|
signatoryUrl: location + _ApplicationContext.default.getBaseApiUrl() + props.config.signatoryUrl,
|
|
@@ -871,7 +981,8 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
871
981
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
872
982
|
style: {
|
|
873
983
|
maxHeight: "calc(70vh - 80px)",
|
|
874
|
-
overflow: "auto"
|
|
984
|
+
overflow: "auto",
|
|
985
|
+
width: "60%"
|
|
875
986
|
},
|
|
876
987
|
className: 'col-*-*',
|
|
877
988
|
id: "signaturePanel",
|
|
@@ -880,7 +991,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
880
991
|
onMouseOut: e => mouseOutHandler(e),
|
|
881
992
|
id: "templateContainer"
|
|
882
993
|
}, /*#__PURE__*/_react.default.createElement(_reactHtmlRenderer.default, {
|
|
883
|
-
html: htmlTemplate
|
|
994
|
+
html: htmlTemplate.replace('<html', "<div name=\"replaced_html\"").replace('</html>', '</div>').replace('<body', "<div name=\"replaced_body\"").replace('</body>', '</div>')
|
|
884
995
|
}))) : null)) : /*#__PURE__*/_react.default.createElement("div", null, "Loading..."));
|
|
885
996
|
}));
|
|
886
997
|
|
|
Binary file
|
package/dist/event/Observable.js
CHANGED
|
@@ -221,7 +221,7 @@ class Observable {
|
|
|
221
221
|
// This happens on async events such as RPC_CALL. If there is no view masking,
|
|
222
222
|
// the REST call may return while the component has been destroyed, and the source's current could be null
|
|
223
223
|
// Proper masking when doing REST CALL should prevent this from happening. The null check provides the sort of defence
|
|
224
|
-
if (!_Utils.default.isNull(be.getSource())) {
|
|
224
|
+
if (!_Utils.default.isNull(be.getSource()) && !_Utils.default.isNull(be.getSource().api)) {
|
|
225
225
|
sourceId = be.getSource().api.id;
|
|
226
226
|
viewId = be.viewId;
|
|
227
227
|
|
|
@@ -15,6 +15,12 @@ var _Utils = _interopRequireDefault(require("../Utils"));
|
|
|
15
15
|
|
|
16
16
|
var _DynamicJS = _interopRequireDefault(require("../DynamicJS"));
|
|
17
17
|
|
|
18
|
+
var _Observable = _interopRequireDefault(require("../event/Observable"));
|
|
19
|
+
|
|
20
|
+
var _EventType = _interopRequireDefault(require("./EventType"));
|
|
21
|
+
|
|
22
|
+
var _Event = _interopRequireDefault(require("./Event"));
|
|
23
|
+
|
|
18
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
25
|
|
|
20
26
|
const location = window.location.protocol + "//" + window.location.hostname;
|
|
@@ -43,9 +49,9 @@ class RouteActionHandler {
|
|
|
43
49
|
if (!_Utils.default.isNull(actionConfig.pathEvaluator)) {
|
|
44
50
|
path = _DynamicJS.default.executeScriptObject(currentViewId + 'ViewEvaluator_' + event.source.id, actionConfig.pathEvaluator);
|
|
45
51
|
} else {
|
|
46
|
-
path = actionConfig.path
|
|
52
|
+
path = _ApplicationContext.default.isExpression(actionConfig.path) ? _ApplicationContext.default.resolveExpressionValue(actionConfig.path, event.data) : actionConfig.path;
|
|
47
53
|
|
|
48
|
-
if ("@#{history.back}" === path) {
|
|
54
|
+
if ("@#{history.back}" === actionConfig.path) {
|
|
49
55
|
let historyElement = _ApplicationContext.default.getPreviousHistoryElement();
|
|
50
56
|
|
|
51
57
|
if (historyElement === null) {
|
|
@@ -64,7 +70,7 @@ class RouteActionHandler {
|
|
|
64
70
|
for (let i = 0; i < actionConfig.parameters.length; i++) {
|
|
65
71
|
let parameter = actionConfig.parameters[i];
|
|
66
72
|
|
|
67
|
-
let parameterValue = _ApplicationContext.default.resolveParameterValue(parameter);
|
|
73
|
+
let parameterValue = _ApplicationContext.default.resolveParameterValue(parameter, event.data);
|
|
68
74
|
|
|
69
75
|
let validator = parameter.validator;
|
|
70
76
|
|
|
@@ -109,10 +115,17 @@ class RouteActionHandler {
|
|
|
109
115
|
} else {
|
|
110
116
|
_ApplicationContext.default.closeCurrentView(false);
|
|
111
117
|
|
|
112
|
-
_ApplicationContext.default.getCurrentView()
|
|
118
|
+
currentView = _ApplicationContext.default.getCurrentView();
|
|
119
|
+
|
|
120
|
+
if (currentView) {
|
|
121
|
+
currentView.handle.api.updateModel(parameterValues);
|
|
122
|
+
let event = new _Event.default(currentView.handle, currentView.config.id, null);
|
|
123
|
+
|
|
124
|
+
_Observable.default.fireEvent(_EventType.default.COMPONENT_LOAD, event);
|
|
125
|
+
}
|
|
113
126
|
}
|
|
114
127
|
} else if (data.type === 'graph') {
|
|
115
|
-
_ApplicationContext.default.loadGraph(isParent, isPopup, data);
|
|
128
|
+
_ApplicationContext.default.loadGraph(isParent, isPopup, data, parameterValues);
|
|
116
129
|
}
|
|
117
130
|
}, e => {
|
|
118
131
|
console.error(e);
|
|
@@ -24,7 +24,7 @@ class ServiceCallActionHandler {
|
|
|
24
24
|
return ServiceCallActionHandler.instance;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
execute(actionConfig, event, component, currentViewId, successCallback, errorCallback) {
|
|
27
|
+
execute(actionConfig, event, component, currentViewId, successCallback, errorCallback, invalidParameterCallback) {
|
|
28
28
|
let method = actionConfig.service.type === 'remoteObjectProxy' ? _RestUtils.invokeRpc : _RestUtils.invokeRest;
|
|
29
29
|
method(actionConfig.service, component, currentViewId, result => {
|
|
30
30
|
let handle = !_Utils.default.isNull(component) && !_Utils.default.isNull(component.current) ? component.current : component;
|
|
@@ -44,12 +44,16 @@ class ServiceCallActionHandler {
|
|
|
44
44
|
successCallback(result);
|
|
45
45
|
}
|
|
46
46
|
}, e => {
|
|
47
|
-
_Utils.default.publishSystemErrorMessage(currentViewId);
|
|
47
|
+
_Utils.default.publishSystemErrorMessage(currentViewId, component);
|
|
48
48
|
|
|
49
49
|
if (!_Utils.default.isNull(errorCallback)) {
|
|
50
50
|
errorCallback(e);
|
|
51
51
|
}
|
|
52
|
-
},
|
|
52
|
+
}, () => {
|
|
53
|
+
if (invalidParameterCallback) {
|
|
54
|
+
invalidParameterCallback();
|
|
55
|
+
}
|
|
56
|
+
}, actionConfig.returnValueBinding, actionConfig.successMessage);
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
}
|
package/dist/js/Addresses.js
CHANGED
|
@@ -12,15 +12,22 @@ class Addresses {
|
|
|
12
12
|
|
|
13
13
|
copy(from, to, checked) {
|
|
14
14
|
if (checked) {
|
|
15
|
-
let
|
|
16
|
-
let
|
|
17
|
-
let
|
|
18
|
-
let
|
|
19
|
-
let
|
|
20
|
-
this.resolver.resolveComponentApi(
|
|
21
|
-
this.resolver.resolveComponentApi(
|
|
22
|
-
this.resolver.resolveComponentApi(
|
|
23
|
-
this.resolver.resolveComponentApi(to + '.
|
|
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;
|
|
21
|
+
let code = this.resolver.resolveComponentApi(from + '.code').value;
|
|
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;
|
|
29
|
+
this.resolver.resolveComponentApi(to + '.code').value = code;
|
|
30
|
+
this.resolver.resolveComponentApi(to + '.building').value = building;
|
|
24
31
|
}
|
|
25
32
|
}
|
|
26
33
|
|