@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
|
@@ -25,7 +25,7 @@ const DocumentContainer = props => {
|
|
|
25
25
|
}, [props.initialImage]);
|
|
26
26
|
_react.default.useEffect(() => {
|
|
27
27
|
createTemplate();
|
|
28
|
-
}, [initialImage, signatureImage]);
|
|
28
|
+
}, [initialImage, signatureImage, props.refresher]);
|
|
29
29
|
const createTemplate = () => {
|
|
30
30
|
let template = props.config.documents[0].template;
|
|
31
31
|
let signers = props.config.documents[0].signers;
|
|
@@ -49,24 +49,26 @@ const DocumentContainer = props => {
|
|
|
49
49
|
if (signer.email === props.config.signatoryId) {
|
|
50
50
|
let signingInputs = signer.signatureInputs;
|
|
51
51
|
for (const signingInput of signingInputs) {
|
|
52
|
-
let
|
|
53
|
-
if ("SIGN" === signingInput.inputType && signatureImage === null || "INITIAL" === signingInput.inputType && initialImage === null) {
|
|
54
|
-
|
|
52
|
+
let border = 'none';
|
|
53
|
+
if ("SIGN" === signingInput.inputType && signatureImage === null || "TEXT_INPUT" === signingInput.inputType && !signingInput.value || "INITIAL" === signingInput.inputType && initialImage === null) {
|
|
54
|
+
border = '2px dashed red';
|
|
55
55
|
}
|
|
56
56
|
console.log(signingInput.tagName + " - " + signingInput.index + " - " + initialImage);
|
|
57
57
|
console.log(signingInput);
|
|
58
|
-
template = template.replace(signingInput.tagName, `<sgvp${signingInput.index} />`);
|
|
59
|
-
rendererProps[`sgvp${signingInput.index}`] =
|
|
58
|
+
template = template.replace(signingInput.tagName + '_', `<sgvp${signingInput.index} />`);
|
|
59
|
+
rendererProps[`sgvp${signingInput.index}`] = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
60
60
|
style: {
|
|
61
61
|
borderRadius: '4px',
|
|
62
62
|
position: 'absolute',
|
|
63
|
-
width: '
|
|
64
|
-
height: '
|
|
63
|
+
width: '100%',
|
|
64
|
+
height: 'inherit',
|
|
65
|
+
border: border
|
|
65
66
|
}
|
|
66
67
|
}, "SIGN" === signingInput.inputType && signatureImage !== null ? /*#__PURE__*/_react.default.createElement("img", {
|
|
67
68
|
src: signatureImage,
|
|
68
69
|
alt: '',
|
|
69
70
|
style: {
|
|
71
|
+
height: 'inherit',
|
|
70
72
|
maxHeight: '100%',
|
|
71
73
|
maxWidth: '100%'
|
|
72
74
|
}
|
|
@@ -74,10 +76,53 @@ const DocumentContainer = props => {
|
|
|
74
76
|
src: initialImage,
|
|
75
77
|
alt: '',
|
|
76
78
|
style: {
|
|
79
|
+
height: 'inherit',
|
|
77
80
|
maxHeight: '100%',
|
|
78
81
|
maxWidth: '100%'
|
|
79
82
|
}
|
|
80
|
-
}) : null
|
|
83
|
+
}) : "TEXT_INPUT" === signingInput.inputType ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
84
|
+
id: signingInput.tagName + "_" + signingInput.index,
|
|
85
|
+
style: {
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
top: 0,
|
|
88
|
+
left: 0,
|
|
89
|
+
width: 'calc(100% - 4px)',
|
|
90
|
+
height: 'calc(100% - 4px)',
|
|
91
|
+
margin: '2px',
|
|
92
|
+
border: 'none',
|
|
93
|
+
zIndex: 0,
|
|
94
|
+
textAlign: 'left'
|
|
95
|
+
},
|
|
96
|
+
onClick: e => {
|
|
97
|
+
let inputText = document.getElementById(signingInput.tagName + "_" + signingInput.index + "_input");
|
|
98
|
+
inputText.value = e.target.innerText;
|
|
99
|
+
inputText.style.display = "inline-block";
|
|
100
|
+
inputText.focus();
|
|
101
|
+
}
|
|
102
|
+
}, signingInput.value), /*#__PURE__*/_react.default.createElement("input", {
|
|
103
|
+
id: signingInput.tagName + "_" + signingInput.index + "_input",
|
|
104
|
+
placeholder: 'Enter text here...',
|
|
105
|
+
style: {
|
|
106
|
+
position: 'absolute',
|
|
107
|
+
top: -4,
|
|
108
|
+
left: 0,
|
|
109
|
+
width: 'calc(100% - 4px)',
|
|
110
|
+
height: 'calc(100% - 4px)',
|
|
111
|
+
margin: '2px',
|
|
112
|
+
border: 'none',
|
|
113
|
+
display: 'none',
|
|
114
|
+
zIndex: 1
|
|
115
|
+
},
|
|
116
|
+
onBlur: e => {
|
|
117
|
+
document.getElementById(signingInput.tagName + "_" + signingInput.index).innerText = e.target.value;
|
|
118
|
+
signingInput.value = e.target.value;
|
|
119
|
+
e.target.style.display = "none";
|
|
120
|
+
props.onInputValueChange(signingInput);
|
|
121
|
+
},
|
|
122
|
+
onChange: e => {
|
|
123
|
+
signingInput.value = e.target.value;
|
|
124
|
+
}
|
|
125
|
+
})) : null);
|
|
81
126
|
}
|
|
82
127
|
}
|
|
83
128
|
}
|
|
@@ -85,7 +130,7 @@ const DocumentContainer = props => {
|
|
|
85
130
|
setDocumentContent(template.replace("<html>", "<!--html-->").replace("</html>", "<!--/html-->").replace("<head>", "<!--head-->").replace("</head>", "<!--/head-->").replace("<body>", "<!--body-->").replace("</body>", "<!--/body-->"));
|
|
86
131
|
};
|
|
87
132
|
return documentContent !== null && htmlRendererProps !== null ? /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
-
className: "container"
|
|
133
|
+
className: "container signature-doc-container"
|
|
89
134
|
}, /*#__PURE__*/_react.default.createElement(_reactHtmlRenderer.default, {
|
|
90
135
|
html: documentContent,
|
|
91
136
|
components: htmlRendererProps
|
|
@@ -13,6 +13,7 @@ var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogAct
|
|
|
13
13
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
14
14
|
var _core = require("@material-ui/core");
|
|
15
15
|
var _SignatorySearch = _interopRequireDefault(require("./SignatorySearch"));
|
|
16
|
+
var _Form = _interopRequireDefault(require("../form/Form"));
|
|
16
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
18
|
const isNull = val => {
|
|
18
19
|
return val === null || typeof val === 'undefined';
|
|
@@ -33,9 +34,22 @@ const SigPropsLookupField = exports.SigPropsLookupField = /*#__PURE__*/_react.de
|
|
|
33
34
|
const [currentSelection, setCurrentSelection] = _react.default.useState(null);
|
|
34
35
|
const [value, setValue] = _react.default.useState(props.value);
|
|
35
36
|
const [open, setOpen] = _react.default.useState(false);
|
|
37
|
+
const formHandle = _react.default.useRef({});
|
|
36
38
|
_react.default.useEffect(() => {
|
|
39
|
+
console.log("NEW PROPS VAL : ", props.value);
|
|
37
40
|
setValue(props.value);
|
|
41
|
+
formHandle.current.api.model = {
|
|
42
|
+
signatory: props.value
|
|
43
|
+
};
|
|
38
44
|
}, [props.value]);
|
|
45
|
+
_react.default.useEffect(() => {
|
|
46
|
+
props.valueChangeHandler('signatory', value);
|
|
47
|
+
}, [value]);
|
|
48
|
+
_react.default.useEffect(() => {
|
|
49
|
+
if (currentSelection) {
|
|
50
|
+
setSelectionAsValue(currentSelection);
|
|
51
|
+
}
|
|
52
|
+
}, [currentSelection]);
|
|
39
53
|
const handleClose = () => {
|
|
40
54
|
setOpen(false);
|
|
41
55
|
};
|
|
@@ -45,14 +59,25 @@ const SigPropsLookupField = exports.SigPropsLookupField = /*#__PURE__*/_react.de
|
|
|
45
59
|
};
|
|
46
60
|
setValue(currentSelection);
|
|
47
61
|
props.valueChangeHandler('signatory', currentSelection);
|
|
48
|
-
|
|
62
|
+
if (!props.signatorySearchForm) {
|
|
63
|
+
handleClose();
|
|
64
|
+
}
|
|
49
65
|
};
|
|
50
66
|
const openSearch = () => {
|
|
51
67
|
setOpen(true);
|
|
52
68
|
};
|
|
53
69
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
54
70
|
className: "w-100 lookup"
|
|
55
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
71
|
+
}, props.signatorySearchForm && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Form.default, {
|
|
72
|
+
disabled: props.disabled,
|
|
73
|
+
config: props.signatorySearchForm,
|
|
74
|
+
handle: formHandle.current,
|
|
75
|
+
valueChangeHandler: _react.default.useCallback(val => {
|
|
76
|
+
setCurrentSelection(val?.signatory);
|
|
77
|
+
}, []),
|
|
78
|
+
viewId: props.viewId,
|
|
79
|
+
className: 'defaultForm'
|
|
80
|
+
})), !props.signatorySearchForm && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("table", {
|
|
56
81
|
className: "w-100"
|
|
57
82
|
}, /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
|
|
58
83
|
width: "200px"
|
|
@@ -109,7 +134,7 @@ const SigPropsLookupField = exports.SigPropsLookupField = /*#__PURE__*/_react.de
|
|
|
109
134
|
onClick: setSelectionAsValue,
|
|
110
135
|
color: "primary",
|
|
111
136
|
disabled: currentSelection === null || typeof currentSelection === 'undefined'
|
|
112
|
-
}, "Ok"))))));
|
|
137
|
+
}, "Ok")))))));
|
|
113
138
|
});
|
|
114
139
|
const SignatureInputProps = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
115
140
|
const classes = useStyles();
|
|
@@ -117,6 +142,7 @@ const SignatureInputProps = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_reac
|
|
|
117
142
|
const [width, setWidth] = _react.default.useState('');
|
|
118
143
|
const [height, setHeight] = _react.default.useState('');
|
|
119
144
|
const [signatory, setSignatory] = _react.default.useState(null);
|
|
145
|
+
const [initialSignatory, setInitialSignatory] = _react.default.useState(null);
|
|
120
146
|
const [widthValid, setWidthValid] = _react.default.useState(true);
|
|
121
147
|
const [heightValid, setHeightValid] = _react.default.useState(true);
|
|
122
148
|
const [signatoryValid, setSignatoryValid] = _react.default.useState(isNull(props.value) || !isNull(props.value.signatory));
|
|
@@ -126,20 +152,32 @@ const SignatureInputProps = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_reac
|
|
|
126
152
|
setWidth(props.value.width);
|
|
127
153
|
setHeight(props.value.height);
|
|
128
154
|
setSignatory(props.value.signatory);
|
|
129
|
-
|
|
130
|
-
|
|
155
|
+
setInitialSignatory(props.value.signatory);
|
|
156
|
+
setWidthValid(validateNumeric(props.value.width, 10000000));
|
|
157
|
+
setHeightValid(validateNumeric(props.value.height, 10000000));
|
|
131
158
|
setSignatoryValid(!isNull(props.value.signatory));
|
|
132
159
|
} else {
|
|
133
160
|
setWidth('');
|
|
134
161
|
setHeight('');
|
|
135
162
|
setSignatory(null);
|
|
163
|
+
setInitialSignatory(null);
|
|
136
164
|
}
|
|
137
165
|
}, [props.value]);
|
|
166
|
+
_react.default.useEffect(() => {
|
|
167
|
+
if (props.dragHeight) {
|
|
168
|
+
setHeight(props.dragHeight);
|
|
169
|
+
}
|
|
170
|
+
}, [props.dragHeight]);
|
|
171
|
+
_react.default.useEffect(() => {
|
|
172
|
+
if (props.dragWidth) {
|
|
173
|
+
setWidth(props.dragWidth);
|
|
174
|
+
}
|
|
175
|
+
}, [props.dragWidth]);
|
|
138
176
|
_react.default.useEffect(() => {
|
|
139
177
|
if (!isNull(value)) {
|
|
140
|
-
let widthCheck = validateNumeric(width,
|
|
178
|
+
let widthCheck = validateNumeric(width, 10000000);
|
|
141
179
|
setWidthValid(widthCheck);
|
|
142
|
-
let heightCheck = validateNumeric(height,
|
|
180
|
+
let heightCheck = validateNumeric(height, 10000000);
|
|
143
181
|
setHeightValid(heightCheck);
|
|
144
182
|
let signatoryCheck = !isNull(signatory);
|
|
145
183
|
setSignatoryValid(signatoryCheck);
|
|
@@ -160,7 +198,7 @@ const SignatureInputProps = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_reac
|
|
|
160
198
|
props.dublicateHandler(value.id);
|
|
161
199
|
};
|
|
162
200
|
const validateNumeric = (val, maxVal) => {
|
|
163
|
-
let regex = new RegExp('
|
|
201
|
+
let regex = new RegExp('^\\d+(\\.\\d+)?$');
|
|
164
202
|
return !isNull(val) && regex.test(val) && parseFloat(val) <= maxVal;
|
|
165
203
|
};
|
|
166
204
|
const valueChangeHandler = (field, fieldValue) => {
|
|
@@ -170,6 +208,9 @@ const SignatureInputProps = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_reac
|
|
|
170
208
|
setHeight(fieldValue);
|
|
171
209
|
} else if ('signatory' === field) {
|
|
172
210
|
setSignatory(fieldValue);
|
|
211
|
+
if (!initialSignatory) {
|
|
212
|
+
setInitialSignatory(fieldValue);
|
|
213
|
+
}
|
|
173
214
|
}
|
|
174
215
|
};
|
|
175
216
|
const save = () => {
|
|
@@ -198,10 +239,12 @@ const SignatureInputProps = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_reac
|
|
|
198
239
|
width: "100%"
|
|
199
240
|
}
|
|
200
241
|
}, /*#__PURE__*/_react.default.createElement(SigPropsLookupField, {
|
|
201
|
-
value:
|
|
242
|
+
value: initialSignatory,
|
|
202
243
|
valueChangeHandler: valueChangeHandler,
|
|
203
244
|
disabled: value === null,
|
|
245
|
+
viewId: props.viewId,
|
|
204
246
|
signatoryUrl: props.signatoryUrl,
|
|
247
|
+
signatorySearchForm: props.signatorySearchForm,
|
|
205
248
|
signatoryService: props.signatoryService,
|
|
206
249
|
error: !signatoryValid
|
|
207
250
|
}), /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
@@ -241,6 +284,13 @@ const SignatureInputProps = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_reac
|
|
|
241
284
|
onChange: e => valueChangeHandler("height", e.target.value),
|
|
242
285
|
variant: "outlined"
|
|
243
286
|
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
287
|
+
variant: "contained",
|
|
288
|
+
component: "span",
|
|
289
|
+
className: classes.button,
|
|
290
|
+
onClick: () => handleApplyToAllPages(),
|
|
291
|
+
disabled: value === null || !widthValid || !heightValid || !signatoryValid,
|
|
292
|
+
id: "signPaletteButton"
|
|
293
|
+
}, "DUPLICATE ITEM ON ALL PAGES"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
244
294
|
variant: "contained",
|
|
245
295
|
component: "span",
|
|
246
296
|
className: classes.button,
|
|
@@ -20,6 +20,8 @@ var _RestUtils = require("../../RestUtils");
|
|
|
20
20
|
var _ServiceCallActionHandler = _interopRequireDefault(require("../../event/ServiceCallActionHandler"));
|
|
21
21
|
var _TemplateItemEventHandler = _interopRequireDefault(require("../TemplateItemEventHandler"));
|
|
22
22
|
require("../TemplateDesigner.css");
|
|
23
|
+
var _DynamicJS = _interopRequireDefault(require("../../DynamicJS"));
|
|
24
|
+
var _Docs = _interopRequireDefault(require("../../js/Docs"));
|
|
23
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
24
26
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
27
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -107,11 +109,15 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
107
109
|
const idCounter = _react.default.useRef(0);
|
|
108
110
|
const [value, setValue] = _react.default.useState(null);
|
|
109
111
|
const [selectedInputBoxValue, setSelectedInputBoxValue] = _react.default.useState(null);
|
|
112
|
+
const [selectedInputBoxDragHeight, setSelectedInputBoxDragHeight] = _react.default.useState(null);
|
|
113
|
+
const [selectedInputBoxDragWidth, setSelectedInputBoxDragWidth] = _react.default.useState(null);
|
|
110
114
|
const [inputBoxValues, setInputBoxValues] = _react.default.useState([]);
|
|
111
115
|
const classes = useStyles();
|
|
112
116
|
const [loading, setLoading] = _react.default.useState(_Utils.default.isNull(props.autoLoadData) || props.autoLoadData === true);
|
|
113
117
|
const documentName = _react.default.useRef(null);
|
|
114
118
|
const [grabbedItem, setGrabbedItem] = _react.default.useState(null);
|
|
119
|
+
const [signatoryUrl, setSignatoryUrl] = _react.default.useState(null);
|
|
120
|
+
const [signatorySearchForm, setSignatorySearchForm] = _react.default.useState(null);
|
|
115
121
|
_react.default.useEffect(() => {
|
|
116
122
|
props.handle.api = api();
|
|
117
123
|
});
|
|
@@ -119,16 +125,21 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
119
125
|
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
120
126
|
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
|
|
121
127
|
_Observable.default.addSystemSubscriptions(props.viewId, parsedConfig);
|
|
128
|
+
setup();
|
|
129
|
+
setSignatoryUrl(_DynamicJS.default.executeScript(`signatoryUrl`, parsedConfig.signatoryUrl));
|
|
130
|
+
setSignatorySearchForm(_DynamicJS.default.executeScript(`signatorySearchForm`, parsedConfig.signatorySearchForm));
|
|
122
131
|
}, []);
|
|
132
|
+
_react.default.useEffect(() => {
|
|
133
|
+
if (props.config.templateDocument) {
|
|
134
|
+
setTemplateDoc(_DynamicJS.default.executeScript(`templateDocument`, props.config.templateDocument));
|
|
135
|
+
}
|
|
136
|
+
}, [props.config.templateDocument]);
|
|
123
137
|
const setup = () => {
|
|
124
138
|
let container = document.getElementById('templateContainer');
|
|
125
139
|
if (!_Utils.default.isNull(templateDoc) && !_Utils.default.isNull(container)) {
|
|
126
|
-
templateItemEventHandler.initDragAndDrop(
|
|
140
|
+
templateItemEventHandler.initDragAndDrop(null, container);
|
|
127
141
|
}
|
|
128
142
|
};
|
|
129
|
-
_react.default.useEffect(() => {
|
|
130
|
-
setup();
|
|
131
|
-
}, []);
|
|
132
143
|
_react.default.useEffect(() => {
|
|
133
144
|
setup();
|
|
134
145
|
}, [templateDoc]);
|
|
@@ -137,6 +148,12 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
137
148
|
props.valueChangeHandler(value);
|
|
138
149
|
}
|
|
139
150
|
}, [value]);
|
|
151
|
+
const memorizedHtmlString = _react.default.useMemo(() => {
|
|
152
|
+
if (templateDoc) {
|
|
153
|
+
return templateDoc.replace('<html', '<div name="replaced_html"').replace('</html>', '</div>').replace('<body', '<div name="replaced_body"').replace('</body>', '</div>');
|
|
154
|
+
}
|
|
155
|
+
return null;
|
|
156
|
+
}, [templateDoc]);
|
|
140
157
|
const api = () => {
|
|
141
158
|
return {
|
|
142
159
|
get id() {
|
|
@@ -211,6 +228,10 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
211
228
|
inputValue = newItem(id, node.style.width, node.style.height);
|
|
212
229
|
inputBoxValues.push(inputValue);
|
|
213
230
|
}
|
|
231
|
+
inputValue.height = node.style.height.replace('px', '');
|
|
232
|
+
inputValue.width = node.style.width.replace('px', '');
|
|
233
|
+
setSelectedInputBoxDragHeight(inputValue.height);
|
|
234
|
+
setSelectedInputBoxDragWidth(inputValue.width);
|
|
214
235
|
saveValue();
|
|
215
236
|
setSelectedInputBoxValue(inputValue);
|
|
216
237
|
});
|
|
@@ -288,51 +309,47 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
288
309
|
setValue(null);
|
|
289
310
|
};
|
|
290
311
|
const getProps = type => {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
312
|
+
switch (type) {
|
|
313
|
+
case 'INITIAL_ITEM':
|
|
314
|
+
return INITIAL_ITEM;
|
|
315
|
+
case 'SIGN_ITEM':
|
|
316
|
+
return SIGN_ITEM;
|
|
295
317
|
}
|
|
296
318
|
return TEXT_ITEM;
|
|
297
319
|
};
|
|
298
320
|
const handleDuplicate = id => {
|
|
299
|
-
// TODO : Fix this function
|
|
300
321
|
let element = document.getElementById(id);
|
|
301
322
|
let pageElements = document.getElementsByClassName('dropTarget');
|
|
302
|
-
let
|
|
303
|
-
let elementTop = 3 * parseFloat(element.style.top.replace('px', '').replace('pt', '')) / 4;
|
|
304
|
-
let pageElementTop = 0;
|
|
305
|
-
for (const pageElement of pageElements) {
|
|
306
|
-
let pageElementHeight = parseFloat(pageElement.style.height.replace('px', '').replace('pt', ''));
|
|
307
|
-
if (elementTop >= pageElementTop && elementTop < pageElementTop + pageElementHeight) {
|
|
308
|
-
elementPage = pageElement;
|
|
309
|
-
break;
|
|
310
|
-
}
|
|
311
|
-
pageElementTop += pageElementHeight;
|
|
312
|
-
}
|
|
313
|
-
let offset = elementTop - pageElementTop;
|
|
323
|
+
let elementTop = parseFloat(element.style.top.replace('px', '').replace('pt', ''));
|
|
314
324
|
let pageNumber = 0;
|
|
315
325
|
let elementData = getInputValue(id);
|
|
316
326
|
for (const pageElement of pageElements) {
|
|
317
|
-
|
|
318
|
-
|
|
327
|
+
if (pageElement !== element.parentElement.parentElement) {
|
|
328
|
+
let newId = idCounter.current++;
|
|
319
329
|
let item = {
|
|
320
|
-
id:
|
|
321
|
-
description: elementData.
|
|
330
|
+
id: newId,
|
|
331
|
+
description: elementData.signatory.emailAddress + "_" + newId,
|
|
322
332
|
type: elementData.type,
|
|
323
333
|
props: getProps(elementData.type)
|
|
324
334
|
};
|
|
335
|
+
inputBoxValues.push({
|
|
336
|
+
...elementData,
|
|
337
|
+
id: newId,
|
|
338
|
+
index: newId
|
|
339
|
+
});
|
|
325
340
|
grabPalleteItem(item);
|
|
326
341
|
let event = {
|
|
327
342
|
target: pageElement
|
|
328
343
|
};
|
|
329
344
|
templateItemEventHandler.handleGrabRelease(event, {
|
|
330
345
|
id: item.id,
|
|
331
|
-
top:
|
|
346
|
+
top: elementTop,
|
|
332
347
|
left: parseFloat(element.style.left.replace('px', '')),
|
|
333
348
|
width: parseFloat(element.style.width.replace('px', '')),
|
|
334
349
|
height: parseFloat(element.style.height.replace('px', '')),
|
|
335
350
|
description: item.description,
|
|
351
|
+
sid: elementData.signatory.emailAddress,
|
|
352
|
+
sdesc: elementData.signatory.names + ' ' + elementData.signatory.lastName,
|
|
336
353
|
type: item.type
|
|
337
354
|
}, (id, node) => {
|
|
338
355
|
let inputValue = getInputValue(id);
|
|
@@ -341,17 +358,21 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
341
358
|
inputBoxValues.push(inputValue);
|
|
342
359
|
setValue(null);
|
|
343
360
|
}
|
|
361
|
+
inputValue.height = node.style.height.replace('px', '');
|
|
362
|
+
inputValue.width = node.style.width.replace('px', '');
|
|
363
|
+
setSelectedInputBoxDragHeight(inputValue.height);
|
|
364
|
+
setSelectedInputBoxDragWidth(inputValue.width);
|
|
344
365
|
setSelectedInputBoxValue(inputValue);
|
|
345
366
|
});
|
|
346
367
|
setGrabbedItem(null);
|
|
347
368
|
}
|
|
348
369
|
pageNumber++;
|
|
349
370
|
}
|
|
371
|
+
saveValue();
|
|
350
372
|
};
|
|
351
373
|
function saveValue() {
|
|
352
374
|
let allValid = true;
|
|
353
375
|
for (const inputBoxValue of inputBoxValues) {
|
|
354
|
-
console.log('\n\n\n\nSIG VAL : ' + inputBoxValue.signatory);
|
|
355
376
|
if (_Utils.default.isNull(inputBoxValue.signatory)) {
|
|
356
377
|
allValid = false;
|
|
357
378
|
break;
|
|
@@ -359,8 +380,8 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
359
380
|
}
|
|
360
381
|
if (allValid) {
|
|
361
382
|
let newValue = {};
|
|
362
|
-
newValue.htmlTemplate = document.getElementById('templateContainer').innerHTML.
|
|
363
|
-
newValue.htmlTemplateBase64 = Base64.encode(newValue.htmlTemplate);
|
|
383
|
+
newValue.htmlTemplate = document.getElementById('templateContainer').innerHTML.replaceAll('2px dashed #a1a1a1', 'none').replaceAll('2px dashed green', 'none').replaceAll('div name="replaced_html"', 'html').replaceAll('div name="replaced_body"', 'body');
|
|
384
|
+
newValue.htmlTemplateBase64 = _Docs.default.removeAllHtmlBackGroundImages(Base64.encode(newValue.htmlTemplate));
|
|
364
385
|
newValue.signatureInputs = inputBoxValues;
|
|
365
386
|
newValue.idCounter = idCounter.current;
|
|
366
387
|
newValue.documentName = documentName.current;
|
|
@@ -378,9 +399,16 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
378
399
|
let element = document.getElementById(id);
|
|
379
400
|
element.style.width = values.width + 'px';
|
|
380
401
|
element.style.height = values.height + 'px';
|
|
402
|
+
element.style.verticalAlign = 'middle';
|
|
403
|
+
element.style.padding = '0 4px';
|
|
404
|
+
element.style.lineHeight = element.style.height;
|
|
405
|
+
element.style.fontSize = '11px';
|
|
381
406
|
element.style.borderColor = VALID_COLOR;
|
|
382
|
-
|
|
383
|
-
|
|
407
|
+
if (values.signatory) {
|
|
408
|
+
element.innerHTML = values.signatory.emailAddress;
|
|
409
|
+
element.setAttribute('sid', values.signatory.emailAddress);
|
|
410
|
+
element.setAttribute('sdesc', values.signatory.names + ' ' + values.signatory.lastName);
|
|
411
|
+
}
|
|
384
412
|
saveValue();
|
|
385
413
|
};
|
|
386
414
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -393,7 +421,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
393
421
|
width: '100%',
|
|
394
422
|
maxHeight: '70vh'
|
|
395
423
|
}
|
|
396
|
-
}, _Utils.default.isNull(props.showToolbar) || props.showToolbar === true ? /*#__PURE__*/_react.default.createElement("div", {
|
|
424
|
+
}, _Utils.default.isNull(props.config.templateDocument) && (_Utils.default.isNull(props.showToolbar) || props.showToolbar === true) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
397
425
|
style: {
|
|
398
426
|
marginBottom: '32px'
|
|
399
427
|
}
|
|
@@ -425,7 +453,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
425
453
|
style: {
|
|
426
454
|
height: 'auto'
|
|
427
455
|
}
|
|
428
|
-
}, !_Utils.default.isNull(
|
|
456
|
+
}, !_Utils.default.isNull(memorizedHtmlString) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
429
457
|
className: 'row'
|
|
430
458
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
431
459
|
className: `${classes.palette} col-*-*`,
|
|
@@ -491,8 +519,12 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
491
519
|
className: `${classes.propertyWindow}`
|
|
492
520
|
}, /*#__PURE__*/_react.default.createElement(_SignatureInputProps.default, {
|
|
493
521
|
value: selectedInputBoxValue,
|
|
494
|
-
|
|
522
|
+
dragWidth: selectedInputBoxDragWidth,
|
|
523
|
+
dragHeight: selectedInputBoxDragHeight,
|
|
524
|
+
signatoryUrl: signatoryUrl,
|
|
525
|
+
viewId: props.viewId,
|
|
495
526
|
signatoryService: props.config.signatoryService,
|
|
527
|
+
signatorySearchForm: signatorySearchForm,
|
|
496
528
|
saveHandler: (id, values) => saveProps(id, values),
|
|
497
529
|
deleteHandler: (id, values) => deleteInputItem(id, values),
|
|
498
530
|
dublicateHandler: id => handleDuplicate(id)
|
|
@@ -500,13 +532,14 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
500
532
|
style: {
|
|
501
533
|
border: '1px solid #e1e1e1',
|
|
502
534
|
borderRadius: '4px',
|
|
503
|
-
|
|
535
|
+
paddingLeft: '8px',
|
|
536
|
+
paddingTop: '8px',
|
|
504
537
|
height: '100%',
|
|
505
538
|
width: 'calc(100% - 288px)'
|
|
506
539
|
},
|
|
507
|
-
className: 'col-*-*',
|
|
540
|
+
className: 'col-*-* templateDesigner',
|
|
508
541
|
onClick: e => mouseClickHandler(e)
|
|
509
|
-
},
|
|
542
|
+
}, memorizedHtmlString ? /*#__PURE__*/_react.default.createElement("div", {
|
|
510
543
|
style: {
|
|
511
544
|
maxHeight: 'calc(70vh - 80px)',
|
|
512
545
|
overflow: 'auto'
|
|
@@ -514,7 +547,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
514
547
|
className: 'col-*-*',
|
|
515
548
|
id: 'templateContainer'
|
|
516
549
|
}, /*#__PURE__*/_react.default.createElement(_reactHtmlRenderer.default, {
|
|
517
|
-
html:
|
|
550
|
+
html: memorizedHtmlString
|
|
518
551
|
})) : /*#__PURE__*/_react.default.createElement("div", {
|
|
519
552
|
style: {
|
|
520
553
|
width: '100%',
|
|
@@ -47,8 +47,11 @@ class ActionHandlers {
|
|
|
47
47
|
let viewId = listener.getViewId();
|
|
48
48
|
this.invokeHandler(action, be, component, viewId);
|
|
49
49
|
}
|
|
50
|
-
invokeHandler(action, be, component, viewId) {
|
|
50
|
+
async invokeHandler(action, be, component, viewId) {
|
|
51
51
|
let actionHandler = this.getActionHandler(action.actionType);
|
|
52
|
+
if (!actionHandler) {
|
|
53
|
+
throw new Error("No action handler found for [" + action.actionType + "]");
|
|
54
|
+
}
|
|
52
55
|
let message = action.confirmationMessage;
|
|
53
56
|
let condition = action.condition;
|
|
54
57
|
let shouldRun = true;
|
|
@@ -57,13 +60,13 @@ class ActionHandlers {
|
|
|
57
60
|
}
|
|
58
61
|
if (shouldRun) {
|
|
59
62
|
if (!_Utils.default.isNull(message)) {
|
|
60
|
-
_ApplicationManager.default.openConfirmDialog(message, result => {
|
|
63
|
+
_ApplicationManager.default.openConfirmDialog(message, async result => {
|
|
61
64
|
if (result === true) {
|
|
62
|
-
actionHandler.execute(action, be, component, viewId);
|
|
65
|
+
await actionHandler.execute(action, be, component, viewId);
|
|
63
66
|
}
|
|
64
67
|
});
|
|
65
68
|
} else {
|
|
66
|
-
actionHandler.execute(action, be, component, viewId);
|
|
69
|
+
await actionHandler.execute(action, be, component, viewId);
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
}
|
|
@@ -34,9 +34,9 @@ class RouteActionHandler {
|
|
|
34
34
|
let isPopup = _Utils.default.isNull(actionConfig.popUp) ? false : actionConfig.popUp;
|
|
35
35
|
let isWindow = _Utils.default.isNull(actionConfig.window) ? false : actionConfig.window;
|
|
36
36
|
if (!_Utils.default.isNull(actionConfig.pathEvaluator)) {
|
|
37
|
-
path = _DynamicJS.default.executeScriptObject(currentViewId + 'ViewEvaluator_' + event
|
|
37
|
+
path = _DynamicJS.default.executeScriptObject(currentViewId + 'ViewEvaluator_' + event?.source.id, actionConfig.pathEvaluator);
|
|
38
38
|
} else {
|
|
39
|
-
path = _ApplicationManager.default.isExpression(actionConfig.path) ? _ApplicationManager.default.resolveExpressionValue(actionConfig.path, event
|
|
39
|
+
path = _ApplicationManager.default.isExpression(actionConfig.path) ? _ApplicationManager.default.resolveExpressionValue(actionConfig.path, event?.data) : actionConfig.path;
|
|
40
40
|
if ('@#{history.back}' === actionConfig.path && _ApplicationManager.default.graphs.length === 0) {
|
|
41
41
|
let historyElement = _ApplicationManager.default.getPreviousHistoryElement();
|
|
42
42
|
if (historyElement === null) {
|
|
@@ -52,7 +52,7 @@ class RouteActionHandler {
|
|
|
52
52
|
if (!_Utils.default.isNull(actionConfig.parameters)) {
|
|
53
53
|
for (let i = 0; i < actionConfig.parameters.length; i++) {
|
|
54
54
|
let parameter = actionConfig.parameters[i];
|
|
55
|
-
let parameterValue = _ApplicationManager.default.resolveParameterValue(parameter, event
|
|
55
|
+
let parameterValue = _ApplicationManager.default.resolveParameterValue(parameter, event?.data);
|
|
56
56
|
let validator = parameter.validator;
|
|
57
57
|
if (_Utils.default.isNull(parameterValue) && !_Utils.default.isNull(validator) && _Utils.default.evaluateBooleanExpression(validator.nullable, parameter.name) === false) {
|
|
58
58
|
console.error('Routing to path ' + path + ', failed. A null value for a NON-NULLABLE parameter was found - ' + JSON.stringify(parameter));
|
|
@@ -15,8 +15,8 @@ class ScriptActionHandler {
|
|
|
15
15
|
return ScriptActionHandler.instance;
|
|
16
16
|
}
|
|
17
17
|
execute(actionConfig, event, component, currentViewId) {
|
|
18
|
-
let componentId = event
|
|
19
|
-
_DynamicJS.default.executeScriptObject(currentViewId + '_' + componentId + '_script', actionConfig.script, componentId, {}, event);
|
|
18
|
+
let componentId = event?.getSource().api.id;
|
|
19
|
+
_DynamicJS.default.executeScriptObject(currentViewId + '_' + (componentId ? componentId : currentViewId) + '_script', actionConfig.script, componentId, {}, event);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
const instance = new ScriptActionHandler();
|