@agilemotion/oui-react-js 1.3.3 → 1.3.5
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/BusinessPortalAppHome.js +21 -7
- package/dist/RestUtils.js +20 -14
- package/dist/Utils.js +0 -2
- package/dist/components/PopupView.js +4 -3
- package/dist/components/SignaturePanel.js +3 -8
- package/dist/components/StepperTitleBar.css +7 -1
- package/dist/components/StepperTitleBar.js +12 -10
- package/dist/components/TemplateDesigner.css +5 -1
- package/dist/components/TemplateDesigner.js +48 -16
- package/dist/components/TemplateItemEventHandler.js +116 -84
- package/dist/components/form/BaseField.js +2 -1
- package/dist/components/form/FieldSet.js +18 -15
- package/dist/components/form/Form.css +1 -0
- package/dist/components/form/Form.js +3 -2
- package/dist/components/form/ImageEditor.js +13 -4
- package/dist/components/layout/Layout.js +0 -1
- package/dist/components/signatures/DocumentContainer.js +4 -4
- package/dist/components/signatures/OLD.js +1138 -0
- package/dist/components/signatures/SignatureInputProps.js +0 -7
- package/dist/components/signatures/SignatureTemplateDesigner.js +197 -487
- package/dist/event/ActionHandlers.js +1 -1
- package/dist/event/LoadDataActionHandler.js +1 -1
- package/dist/event/ServiceCallActionHandler.js +1 -1
- package/package.json +1 -1
|
@@ -33,6 +33,10 @@ var _RestUtils = require("../../RestUtils");
|
|
|
33
33
|
|
|
34
34
|
var _ServiceCallActionHandler = _interopRequireDefault(require("../../event/ServiceCallActionHandler"));
|
|
35
35
|
|
|
36
|
+
var _TemplateItemEventHandler = _interopRequireDefault(require("../TemplateItemEventHandler"));
|
|
37
|
+
|
|
38
|
+
require("../TemplateDesigner.css");
|
|
39
|
+
|
|
36
40
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
37
41
|
|
|
38
42
|
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; }
|
|
@@ -54,22 +58,16 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
54
58
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
55
59
|
|
|
56
60
|
const INITIAL_ITEM = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
defaultWidthOnPageDrop: "80px",
|
|
60
|
-
defaultHeightOnPageDrop: "80px"
|
|
61
|
+
defaultWidthOnPageDrop: 80,
|
|
62
|
+
defaultHeightOnPageDrop: 80
|
|
61
63
|
};
|
|
62
64
|
const SIGN_ITEM = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
defaultWidthOnPageDrop: "200px",
|
|
66
|
-
defaultHeightOnPageDrop: "80px"
|
|
65
|
+
defaultWidthOnPageDrop: 200,
|
|
66
|
+
defaultHeightOnPageDrop: 80
|
|
67
67
|
};
|
|
68
68
|
const TEXT_ITEM = {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
defaultWidthOnPageDrop: "200px",
|
|
72
|
-
defaultHeightOnPageDrop: "80px"
|
|
69
|
+
defaultWidthOnPageDrop: 200,
|
|
70
|
+
defaultHeightOnPageDrop: 80
|
|
73
71
|
};
|
|
74
72
|
const DROP_ITEM_MARGIN = 32;
|
|
75
73
|
const types = [INITIAL_ITEM, SIGN_ITEM, TEXT_ITEM];
|
|
@@ -98,7 +96,8 @@ const useStyles = (0, _core.makeStyles)(theme => ({
|
|
|
98
96
|
margin: "4px",
|
|
99
97
|
textAlign: "center",
|
|
100
98
|
padding: "28px 0",
|
|
101
|
-
borderRadius: "4px"
|
|
99
|
+
borderRadius: "4px",
|
|
100
|
+
cursor: 'grabbing'
|
|
102
101
|
},
|
|
103
102
|
paletteButtonSelected: {
|
|
104
103
|
'&:hover': {
|
|
@@ -110,7 +109,8 @@ const useStyles = (0, _core.makeStyles)(theme => ({
|
|
|
110
109
|
margin: "4px",
|
|
111
110
|
textAlign: "center",
|
|
112
111
|
padding: "28px 0",
|
|
113
|
-
borderRadius: "4px"
|
|
112
|
+
borderRadius: "4px",
|
|
113
|
+
cursor: 'grabbing'
|
|
114
114
|
},
|
|
115
115
|
palette: {
|
|
116
116
|
width: "280px",
|
|
@@ -133,10 +133,9 @@ const json = response => {
|
|
|
133
133
|
return response.text();
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
-
const VALID_COLOR = "green";
|
|
137
|
-
const INVALID_COLOR = "red";
|
|
138
136
|
const location = window.location.protocol + "//" + window.location.hostname;
|
|
139
|
-
const
|
|
137
|
+
const templateItemEventHandler = new _TemplateItemEventHandler.default();
|
|
138
|
+
const VALID_COLOR = "green";
|
|
140
139
|
|
|
141
140
|
const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
142
141
|
const _React$useState = _react.default.useState(null),
|
|
@@ -146,8 +145,8 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
146
145
|
|
|
147
146
|
const _React$useState3 = _react.default.useState(null),
|
|
148
147
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
templateDoc = _React$useState4[0],
|
|
149
|
+
setTemplateDoc = _React$useState4[1];
|
|
151
150
|
|
|
152
151
|
const _React$useState5 = _react.default.useState(null),
|
|
153
152
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
@@ -187,10 +186,15 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
187
186
|
|
|
188
187
|
const documentName = _react.default.useRef(null);
|
|
189
188
|
|
|
190
|
-
_react.default.
|
|
191
|
-
|
|
189
|
+
const _React$useState17 = _react.default.useState(null),
|
|
190
|
+
_React$useState18 = _slicedToArray(_React$useState17, 2),
|
|
191
|
+
grabbedItem = _React$useState18[0],
|
|
192
|
+
setGrabbedItem = _React$useState18[1];
|
|
192
193
|
|
|
194
|
+
_react.default.useEffect(() => {
|
|
193
195
|
if (initializing) {
|
|
196
|
+
props.handle.api = api();
|
|
197
|
+
|
|
194
198
|
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
195
199
|
|
|
196
200
|
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
|
|
@@ -205,6 +209,22 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
205
209
|
}
|
|
206
210
|
});
|
|
207
211
|
|
|
212
|
+
const setup = () => {
|
|
213
|
+
let container = document.getElementById('templateContainer');
|
|
214
|
+
|
|
215
|
+
if (!_Utils.default.isNull(templateDoc) && !_Utils.default.isNull(container)) {
|
|
216
|
+
templateItemEventHandler.initDragAndDrop(id => {}, container);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
_react.default.useEffect(() => {
|
|
221
|
+
setup();
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
_react.default.useEffect(() => {
|
|
225
|
+
setup();
|
|
226
|
+
}, [templateDoc]);
|
|
227
|
+
|
|
208
228
|
_react.default.useEffect(() => {
|
|
209
229
|
if (!_Utils.default.isNull(props.valueChangeHandler)) {
|
|
210
230
|
props.valueChangeHandler(value);
|
|
@@ -240,7 +260,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
240
260
|
actionConfig.service = service;
|
|
241
261
|
|
|
242
262
|
_ServiceCallActionHandler.default.execute(actionConfig, null, null, props.viewId, data => {
|
|
243
|
-
|
|
263
|
+
setTemplateDoc(data.template);
|
|
244
264
|
setLoading(false);
|
|
245
265
|
}, () => {});
|
|
246
266
|
}
|
|
@@ -252,7 +272,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
252
272
|
setValue(value);
|
|
253
273
|
|
|
254
274
|
if (!_Utils.default.isNull(value)) {
|
|
255
|
-
|
|
275
|
+
setTemplateDoc(value.htmlTemplate);
|
|
256
276
|
setInputBoxValues(value.signatureInputs);
|
|
257
277
|
idCounter.current = value.idCounter;
|
|
258
278
|
}
|
|
@@ -273,193 +293,47 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
273
293
|
};
|
|
274
294
|
};
|
|
275
295
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
let mouseOutHandler = function mouseOutHandler(event) {
|
|
285
|
-
if (typeof event.target.className === 'string' && event.target.className.includes("dropTarget")) {
|
|
286
|
-
let originalBorder = event.target.getAttribute("originalBorder");
|
|
287
|
-
|
|
288
|
-
if (_Utils.default.isNull(originalBorder)) {
|
|
289
|
-
originalBorder = "";
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
event.target.style.border = originalBorder;
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
const resetBorders = item => {
|
|
297
|
-
let elements = document.getElementsByClassName("_draggable_" + item.type);
|
|
298
|
-
|
|
299
|
-
var _iterator = _createForOfIteratorHelper(elements),
|
|
300
|
-
_step;
|
|
301
|
-
|
|
302
|
-
try {
|
|
303
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
304
|
-
const element = _step.value;
|
|
305
|
-
element.style.borderWidth = "2px";
|
|
306
|
-
}
|
|
307
|
-
} catch (err) {
|
|
308
|
-
_iterator.e(err);
|
|
309
|
-
} finally {
|
|
310
|
-
_iterator.f();
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
const getAllInputBoxElements = () => {
|
|
315
|
-
let elements = [];
|
|
316
|
-
|
|
317
|
-
var _iterator2 = _createForOfIteratorHelper(types),
|
|
318
|
-
_step2;
|
|
319
|
-
|
|
320
|
-
try {
|
|
321
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
322
|
-
const type = _step2.value;
|
|
323
|
-
|
|
324
|
-
var _iterator3 = _createForOfIteratorHelper(document.getElementsByClassName("_draggable_" + type.type)),
|
|
325
|
-
_step3;
|
|
326
|
-
|
|
327
|
-
try {
|
|
328
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
329
|
-
const element = _step3.value;
|
|
330
|
-
elements.push(element);
|
|
331
|
-
}
|
|
332
|
-
} catch (err) {
|
|
333
|
-
_iterator3.e(err);
|
|
334
|
-
} finally {
|
|
335
|
-
_iterator3.f();
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
} catch (err) {
|
|
339
|
-
_iterator2.e(err);
|
|
340
|
-
} finally {
|
|
341
|
-
_iterator2.f();
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
return elements;
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
const getPageDropOffset = (left, top) => {
|
|
348
|
-
let leftOffset = 0;
|
|
349
|
-
let topOffset = 0;
|
|
350
|
-
let elements = getAllInputBoxElements();
|
|
351
|
-
|
|
352
|
-
var _iterator4 = _createForOfIteratorHelper(elements),
|
|
353
|
-
_step4;
|
|
354
|
-
|
|
355
|
-
try {
|
|
356
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
357
|
-
const element = _step4.value;
|
|
358
|
-
|
|
359
|
-
if (parseFloat(element.style.left.replace('px', '')) === left) {
|
|
360
|
-
leftOffset += 4;
|
|
361
|
-
left = parseFloat(element.style.left.replace('px', '')) + 4;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
if (parseFloat(element.style.top.replace('px', '')) === top) {
|
|
365
|
-
topOffset += 4;
|
|
366
|
-
top = parseFloat(element.style.top.replace('px', ''));
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
} catch (err) {
|
|
370
|
-
_iterator4.e(err);
|
|
371
|
-
} finally {
|
|
372
|
-
_iterator4.f();
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
return {
|
|
376
|
-
leftOffset: leftOffset,
|
|
377
|
-
topOffset: topOffset
|
|
378
|
-
};
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
const convertToPixels = val => {
|
|
382
|
-
if (val.includes("pt")) {
|
|
383
|
-
let numericValue = parseFloat(val.replace('pt', ''));
|
|
384
|
-
return (4 * numericValue / 3).toFixed(0) + "px";
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
return val;
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
const resetAllBorder = () => {
|
|
391
|
-
resetBorders(INITIAL_ITEM);
|
|
392
|
-
resetBorders(SIGN_ITEM);
|
|
393
|
-
resetBorders(TEXT_ITEM);
|
|
296
|
+
const newItem = (id, width, height) => {
|
|
297
|
+
let inputValue = {};
|
|
298
|
+
inputValue.id = id;
|
|
299
|
+
inputValue.height = height.replace("px", "");
|
|
300
|
+
inputValue.width = width.replace("px", "");
|
|
301
|
+
inputValue.type = paletteSelection.current === "INITIAL_ITEM" ? "INITIAL" : paletteSelection.current === "SIGN_ITEM" ? "SIGN" : "TEXT INPUT";
|
|
302
|
+
return inputValue;
|
|
394
303
|
};
|
|
395
304
|
|
|
396
305
|
let mouseClickHandler = function mouseClickHandler(event) {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
if (event.target.className.includes("page")) {
|
|
413
|
-
let top = !_Utils.default.isNull(event.target.style.top) && event.target.style.top.trim().length > 0 ? event.target.style.top.replaceAll('pt', '') : '0';
|
|
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');
|
|
417
|
-
node.style.width = paletteSelection.current.defaultWidthOnPageDrop;
|
|
418
|
-
node.style.height = paletteSelection.current.defaultHeightOnPageDrop;
|
|
419
|
-
node.style.padding = '8px';
|
|
420
|
-
node.style.left = DROP_ITEM_MARGIN + pageDropOffset.leftOffset + 'px';
|
|
421
|
-
event.target.appendChild(node);
|
|
422
|
-
} else {
|
|
423
|
-
let lineHeight = event.target.style.lineHeight;
|
|
424
|
-
let hasLineHeight = !_Utils.default.isNull(lineHeight) && lineHeight.trim().length > 0 && lineHeight.toString() !== '0';
|
|
425
|
-
node.style.top = hasLineHeight ? event.target.style.top : convertToPixels(parseFloat(event.target.style.top.replace('pt', '')) - 14.5 + 'pt');
|
|
426
|
-
node.style.left = event.target.style.left;
|
|
427
|
-
node.style.width = convertToPixels(event.target.style.width);
|
|
428
|
-
node.style.height = convertToPixels(hasLineHeight ? event.target.style.lineHeight : '14.5pt');
|
|
429
|
-
node.style.padding = parseFloat(node.style.height.replace('px', '')) > 32 ? '8px' : '0px';
|
|
430
|
-
event.target.parentElement.appendChild(node);
|
|
306
|
+
if (grabbedItem) {
|
|
307
|
+
setSelectedInputBoxValue(null);
|
|
308
|
+
templateItemEventHandler.handleGrabRelease(event, {
|
|
309
|
+
id: grabbedItem.id,
|
|
310
|
+
width: grabbedItem.props.defaultWidthOnPageDrop,
|
|
311
|
+
height: grabbedItem.props.defaultHeightOnPageDrop,
|
|
312
|
+
description: grabbedItem.description,
|
|
313
|
+
type: grabbedItem.type
|
|
314
|
+
}, (id, node) => {
|
|
315
|
+
let inputValue = getInputValue(id);
|
|
316
|
+
|
|
317
|
+
if (!inputValue) {
|
|
318
|
+
inputValue = newItem(id, node.style.width, node.style.height);
|
|
319
|
+
inputBoxValues.push(inputValue);
|
|
320
|
+
setValue(null);
|
|
431
321
|
}
|
|
432
322
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
inputValue.id = node.id;
|
|
436
|
-
inputValue.height = node.style.height.replace("px", "");
|
|
437
|
-
inputValue.width = node.style.width.replace("px", "");
|
|
438
|
-
inputValue.type = paletteSelection.current.type === "initial" ? "INITIAL" : paletteSelection.current.type === "sign" ? "SIGN" : "TEXT INPUT";
|
|
439
|
-
inputBoxValues.push(inputValue);
|
|
440
|
-
setValue(null);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
paletteSelection.current = null;
|
|
444
|
-
setPaletteSelectionId(null);
|
|
445
|
-
} else if (event.target.className.includes("_draggable_")) {
|
|
446
|
-
event.target.style.borderWidth = "4px";
|
|
447
|
-
let inputValue = getInputValue(event.target.id);
|
|
448
|
-
setSelectedInputBoxValue(inputValue);
|
|
323
|
+
setSelectedInputBoxValue(inputValue);
|
|
324
|
+
});
|
|
449
325
|
}
|
|
450
326
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
setPaletteSelectionId(null);
|
|
454
|
-
document.getElementsByTagName("body")[0].style.cursor = 'default';
|
|
455
|
-
}
|
|
327
|
+
setPaletteSelectionId(null);
|
|
328
|
+
setGrabbedItem(null);
|
|
456
329
|
};
|
|
457
330
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
331
|
+
const grabPalleteItem = item => {
|
|
332
|
+
document.getElementsByTagName("body")[0].style.cursor = 'grabbing';
|
|
333
|
+
setPaletteSelectionId(item.type);
|
|
334
|
+
paletteSelection.current = item.type;
|
|
335
|
+
setGrabbedItem(item);
|
|
336
|
+
};
|
|
463
337
|
|
|
464
338
|
_react.default.useEffect(() => {
|
|
465
339
|
let event = new _Event.default(props.handle, props.viewId, value);
|
|
@@ -467,195 +341,15 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
467
341
|
_Observable.default.fireEvent(_EventType.default.VALUE_CHANGE, event);
|
|
468
342
|
}, [value]);
|
|
469
343
|
|
|
470
|
-
const initDragAndDrop = className => {
|
|
471
|
-
setTimeout(() => {
|
|
472
|
-
let elements = document.getElementsByClassName(className);
|
|
473
|
-
|
|
474
|
-
var _iterator5 = _createForOfIteratorHelper(elements),
|
|
475
|
-
_step5;
|
|
476
|
-
|
|
477
|
-
try {
|
|
478
|
-
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
479
|
-
const element = _step5.value;
|
|
480
|
-
|
|
481
|
-
if (className !== "page") {
|
|
482
|
-
element.addEventListener("dragstart", dragStart, false);
|
|
483
|
-
}
|
|
484
|
-
|
|
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();
|
|
492
|
-
}
|
|
493
|
-
}, 2000);
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
const destroyEvents = () => {
|
|
497
|
-
let elements = document.getElementsByClassName("page");
|
|
498
|
-
|
|
499
|
-
var _iterator6 = _createForOfIteratorHelper(elements),
|
|
500
|
-
_step6;
|
|
501
|
-
|
|
502
|
-
try {
|
|
503
|
-
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
504
|
-
const element = _step6.value;
|
|
505
|
-
element.removeEventListener("dragover", dragOver);
|
|
506
|
-
element.removeEventListener("drop", drop);
|
|
507
|
-
}
|
|
508
|
-
} catch (err) {
|
|
509
|
-
_iterator6.e(err);
|
|
510
|
-
} finally {
|
|
511
|
-
_iterator6.f();
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
let allInputs = getAllInputBoxElements();
|
|
515
|
-
|
|
516
|
-
var _iterator7 = _createForOfIteratorHelper(allInputs),
|
|
517
|
-
_step7;
|
|
518
|
-
|
|
519
|
-
try {
|
|
520
|
-
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
521
|
-
const element = _step7.value;
|
|
522
|
-
element.removeEventListener("dragover", dragOver);
|
|
523
|
-
element.removeEventListener("drop", drop);
|
|
524
|
-
element.removeEventListener("dropStart", dragStart);
|
|
525
|
-
}
|
|
526
|
-
} catch (err) {
|
|
527
|
-
_iterator7.e(err);
|
|
528
|
-
} finally {
|
|
529
|
-
_iterator7.f();
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
|
|
533
|
-
_react.default.useEffect(() => {
|
|
534
|
-
initDragAndDrop("page");
|
|
535
|
-
|
|
536
|
-
var _iterator8 = _createForOfIteratorHelper(types),
|
|
537
|
-
_step8;
|
|
538
|
-
|
|
539
|
-
try {
|
|
540
|
-
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
541
|
-
const type = _step8.value;
|
|
542
|
-
initDragAndDrop("_draggable_" + type.type);
|
|
543
|
-
resetBorders(type);
|
|
544
|
-
}
|
|
545
|
-
} catch (err) {
|
|
546
|
-
_iterator8.e(err);
|
|
547
|
-
} finally {
|
|
548
|
-
_iterator8.f();
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
if (!loading) {
|
|
552
|
-
setValue(null);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
setSelectedInputBoxValue(null);
|
|
556
|
-
setInputBoxValues([]);
|
|
557
|
-
setPaletteSelectionId(null);
|
|
558
|
-
}, [htmlTemplate]);
|
|
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
|
-
|
|
597
|
-
function handleDragDrop(event) {
|
|
598
|
-
let offset;
|
|
599
|
-
offset = dragAndDropData.offset.split(',');
|
|
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
|
-
|
|
629
|
-
event.preventDefault();
|
|
630
|
-
return false;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
function dragStart(event) {
|
|
634
|
-
document.body.style.cursor = "move";
|
|
635
|
-
let style = window.getComputedStyle(event.target, null);
|
|
636
|
-
dragAndDropData.offset = parseInt(style.getPropertyValue("left"), 10) - event.clientX + ',' + (parseInt(style.getPropertyValue("top"), 10) - event.clientY);
|
|
637
|
-
dragAndDropData.id = event.target.id;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
function dragOver(event) {
|
|
641
|
-
document.body.style.cursor = "move";
|
|
642
|
-
return handleDragDrop(event);
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
function drop(event) {
|
|
646
|
-
document.body.style.cursor = "default";
|
|
647
|
-
return handleDragDrop(event);
|
|
648
|
-
}
|
|
649
|
-
|
|
650
344
|
const getInputValue = id => {
|
|
651
345
|
let index = 0;
|
|
652
346
|
|
|
653
|
-
var
|
|
654
|
-
|
|
347
|
+
var _iterator = _createForOfIteratorHelper(inputBoxValues),
|
|
348
|
+
_step;
|
|
655
349
|
|
|
656
350
|
try {
|
|
657
|
-
for (
|
|
658
|
-
const inputBoxValue =
|
|
351
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
352
|
+
const inputBoxValue = _step.value;
|
|
659
353
|
|
|
660
354
|
if (inputBoxValue.id === id) {
|
|
661
355
|
inputBoxValue.index = index;
|
|
@@ -665,16 +359,16 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
665
359
|
index++;
|
|
666
360
|
}
|
|
667
361
|
} catch (err) {
|
|
668
|
-
|
|
362
|
+
_iterator.e(err);
|
|
669
363
|
} finally {
|
|
670
|
-
|
|
364
|
+
_iterator.f();
|
|
671
365
|
}
|
|
672
366
|
|
|
673
367
|
return null;
|
|
674
368
|
};
|
|
675
369
|
|
|
676
370
|
const handleSubmit = () => event => {
|
|
677
|
-
|
|
371
|
+
setTemplateDoc("");
|
|
678
372
|
const accessToken = sessionStorage.getItem("accessToken");
|
|
679
373
|
const idToken = sessionStorage.getItem("idToken");
|
|
680
374
|
let data = new FormData();
|
|
@@ -692,7 +386,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
692
386
|
};
|
|
693
387
|
let url = location + _ApplicationContext.default.getBaseApiUrl() + props.config.documentConverterUrl;
|
|
694
388
|
(0, _reactPromiseTracker.trackPromise)(fetch(encodeURI(url), fetchConfig).then(status).then(json).then(data => {
|
|
695
|
-
|
|
389
|
+
setTemplateDoc(data);
|
|
696
390
|
setFile(null);
|
|
697
391
|
}).catch(e => {
|
|
698
392
|
if (e.code === 401) {
|
|
@@ -718,38 +412,40 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
718
412
|
};
|
|
719
413
|
|
|
720
414
|
const clear = () => {
|
|
721
|
-
|
|
722
|
-
_step12;
|
|
415
|
+
let elements = document.getElementsByClassName('_draggable_');
|
|
723
416
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
const inputBoxValue = _step12.value;
|
|
727
|
-
document.getElementById(inputBoxValue.id).remove();
|
|
728
|
-
}
|
|
729
|
-
} catch (err) {
|
|
730
|
-
_iterator12.e(err);
|
|
731
|
-
} finally {
|
|
732
|
-
_iterator12.f();
|
|
417
|
+
while (elements.length > 0) {
|
|
418
|
+
elements[0].remove();
|
|
733
419
|
}
|
|
734
420
|
|
|
735
421
|
inputBoxValues.splice(0, inputBoxValues.length);
|
|
736
422
|
setValue(null);
|
|
737
423
|
};
|
|
738
424
|
|
|
425
|
+
const getProps = type => {
|
|
426
|
+
if (type === 'INITIAL_ITEM') {
|
|
427
|
+
return INITIAL_ITEM;
|
|
428
|
+
} else if (type === 'SIGN_ITEM') {
|
|
429
|
+
return SIGN_ITEM;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return TEXT_ITEM;
|
|
433
|
+
};
|
|
434
|
+
|
|
739
435
|
const handleDuplicate = id => {
|
|
740
|
-
|
|
436
|
+
// TODO : Fix this function
|
|
741
437
|
let element = document.getElementById(id);
|
|
742
|
-
let pageElements = document.getElementsByClassName("
|
|
438
|
+
let pageElements = document.getElementsByClassName("dropTarget");
|
|
743
439
|
let elementPage = null;
|
|
744
440
|
let elementTop = 3 * parseFloat(element.style.top.replace("px", '').replace('pt', '')) / 4;
|
|
745
441
|
let pageElementTop = 0;
|
|
746
442
|
|
|
747
|
-
var
|
|
748
|
-
|
|
443
|
+
var _iterator2 = _createForOfIteratorHelper(pageElements),
|
|
444
|
+
_step2;
|
|
749
445
|
|
|
750
446
|
try {
|
|
751
|
-
for (
|
|
752
|
-
const pageElement =
|
|
447
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
448
|
+
const pageElement = _step2.value;
|
|
753
449
|
let pageElementHeight = parseFloat(pageElement.style.height.replace("px", '').replace('pt', ''));
|
|
754
450
|
|
|
755
451
|
if (elementTop >= pageElementTop && elementTop < pageElementTop + pageElementHeight) {
|
|
@@ -760,68 +456,74 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
760
456
|
pageElementTop += pageElementHeight;
|
|
761
457
|
}
|
|
762
458
|
} catch (err) {
|
|
763
|
-
|
|
459
|
+
_iterator2.e(err);
|
|
764
460
|
} finally {
|
|
765
|
-
|
|
461
|
+
_iterator2.f();
|
|
766
462
|
}
|
|
767
463
|
|
|
768
464
|
let offset = elementTop - pageElementTop;
|
|
769
465
|
let pageNumber = 0;
|
|
770
466
|
let elementData = getInputValue(id);
|
|
771
467
|
|
|
772
|
-
var
|
|
773
|
-
|
|
468
|
+
var _iterator3 = _createForOfIteratorHelper(pageElements),
|
|
469
|
+
_step3;
|
|
774
470
|
|
|
775
471
|
try {
|
|
776
|
-
for (
|
|
777
|
-
const pageElement =
|
|
472
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
473
|
+
const pageElement = _step3.value;
|
|
778
474
|
let pageElementHeight = parseFloat(pageElement.style.height.replace("px", '').replace('pt', ''));
|
|
779
475
|
|
|
780
476
|
if (pageElement !== elementPage) {
|
|
781
|
-
let
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
477
|
+
let item = {
|
|
478
|
+
id: idCounter.current++,
|
|
479
|
+
description: elementData.description,
|
|
480
|
+
type: elementData.type,
|
|
481
|
+
props: getProps(elementData.type)
|
|
482
|
+
};
|
|
483
|
+
grabPalleteItem(item);
|
|
484
|
+
let event = {
|
|
485
|
+
target: pageElement
|
|
486
|
+
};
|
|
487
|
+
templateItemEventHandler.handleGrabRelease(event, {
|
|
488
|
+
id: item.id,
|
|
489
|
+
top: pageNumber * pageElementHeight + offset,
|
|
490
|
+
left: parseFloat(element.style.left.replace("px", "")),
|
|
491
|
+
width: parseFloat(element.style.width.replace("px", "")),
|
|
492
|
+
height: parseFloat(element.style.height.replace("px", "")),
|
|
493
|
+
description: item.description,
|
|
494
|
+
type: item.type
|
|
495
|
+
}, (id, node) => {
|
|
496
|
+
let inputValue = getInputValue(id);
|
|
497
|
+
|
|
498
|
+
if (!inputValue) {
|
|
499
|
+
inputValue = newItem(item.id, node.style.width, node.style.height);
|
|
500
|
+
inputBoxValues.push(inputValue);
|
|
501
|
+
setValue(null);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
setSelectedInputBoxValue(inputValue);
|
|
505
|
+
});
|
|
506
|
+
setGrabbedItem(null);
|
|
807
507
|
}
|
|
508
|
+
|
|
509
|
+
pageNumber++;
|
|
808
510
|
}
|
|
809
511
|
} catch (err) {
|
|
810
|
-
|
|
512
|
+
_iterator3.e(err);
|
|
811
513
|
} finally {
|
|
812
|
-
|
|
514
|
+
_iterator3.f();
|
|
813
515
|
}
|
|
814
516
|
};
|
|
815
517
|
|
|
816
518
|
function saveValue() {
|
|
817
519
|
let allValid = true;
|
|
818
520
|
|
|
819
|
-
var
|
|
820
|
-
|
|
521
|
+
var _iterator4 = _createForOfIteratorHelper(inputBoxValues),
|
|
522
|
+
_step4;
|
|
821
523
|
|
|
822
524
|
try {
|
|
823
|
-
for (
|
|
824
|
-
const inputBoxValue =
|
|
525
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
526
|
+
const inputBoxValue = _step4.value;
|
|
825
527
|
|
|
826
528
|
if (_Utils.default.isNull(inputBoxValue.signatory)) {
|
|
827
529
|
allValid = false;
|
|
@@ -829,14 +531,14 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
829
531
|
}
|
|
830
532
|
}
|
|
831
533
|
} catch (err) {
|
|
832
|
-
|
|
534
|
+
_iterator4.e(err);
|
|
833
535
|
} finally {
|
|
834
|
-
|
|
536
|
+
_iterator4.f();
|
|
835
537
|
}
|
|
836
538
|
|
|
837
539
|
if (allValid) {
|
|
838
540
|
let newValue = {};
|
|
839
|
-
newValue.htmlTemplate = document.getElementById("templateContainer").innerHTML.replace("div name=\"replaced_html\"", "html").replace("div name=\"replaced_body\"", "body");
|
|
541
|
+
newValue.htmlTemplate = document.getElementById("templateContainer").innerHTML.replace("2px dashed #a1a1a1", "none").replace("2px dashed green", "none").replace("div name=\"replaced_html\"", "html").replace("div name=\"replaced_body\"", "body");
|
|
840
542
|
newValue.htmlTemplateBase64 = Base64.encode(newValue.htmlTemplate);
|
|
841
543
|
newValue.signatureInputs = inputBoxValues;
|
|
842
544
|
newValue.idCounter = idCounter.current;
|
|
@@ -857,7 +559,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
857
559
|
element.style.width = values.width + "px";
|
|
858
560
|
element.style.height = values.height + "px";
|
|
859
561
|
element.style.borderColor = VALID_COLOR;
|
|
860
|
-
element.innerText = values.signatory.map.
|
|
562
|
+
element.innerText = values.signatory.map.emailAddress + "_" + id;
|
|
861
563
|
element.setAttribute("sid", values.signatory.map.emailAddress);
|
|
862
564
|
saveValue();
|
|
863
565
|
};
|
|
@@ -904,62 +606,58 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
904
606
|
style: {
|
|
905
607
|
height: "auto"
|
|
906
608
|
}
|
|
907
|
-
}, !_Utils.default.isNull(
|
|
609
|
+
}, !_Utils.default.isNull(templateDoc) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
908
610
|
className: 'row'
|
|
909
611
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
910
612
|
className: "".concat(classes.palette, " col-*-*"),
|
|
911
613
|
style: {
|
|
912
614
|
maxHeight: "calc(70vh - 80px)",
|
|
913
|
-
overflow: "auto"
|
|
615
|
+
overflow: "auto",
|
|
616
|
+
width: '280px'
|
|
914
617
|
}
|
|
915
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
916
|
-
className: "col-*-*"
|
|
917
618
|
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
918
619
|
variant: "contained",
|
|
919
620
|
component: "span",
|
|
920
621
|
className: paletteSelectionId === 'INITIAL_ITEM' ? classes.paletteButtonSelected : classes.paletteButton,
|
|
921
|
-
onClick: () => {
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
622
|
+
onClick: () => grabPalleteItem({
|
|
623
|
+
id: idCounter.current++,
|
|
624
|
+
description: 'Initial',
|
|
625
|
+
type: 'INITIAL_ITEM',
|
|
626
|
+
props: INITIAL_ITEM
|
|
627
|
+
}),
|
|
926
628
|
id: "initialPaletteButton",
|
|
927
629
|
classes: {
|
|
928
630
|
"label": "paletteButtonLabel"
|
|
929
631
|
}
|
|
930
|
-
}, "Initial Pad")
|
|
931
|
-
className: "col-*-*"
|
|
932
|
-
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
632
|
+
}, "Initial Pad"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
933
633
|
variant: "contained",
|
|
934
634
|
component: "span",
|
|
935
635
|
className: paletteSelectionId === 'SIGN_ITEM' ? classes.paletteButtonSelected : classes.paletteButton,
|
|
936
|
-
onClick: () => {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
636
|
+
onClick: () => grabPalleteItem({
|
|
637
|
+
id: idCounter.current++,
|
|
638
|
+
description: 'Signature',
|
|
639
|
+
type: 'SIGN_ITEM',
|
|
640
|
+
props: SIGN_ITEM
|
|
641
|
+
}),
|
|
642
|
+
id: "initialPaletteButton",
|
|
942
643
|
classes: {
|
|
943
644
|
"label": "paletteButtonLabel"
|
|
944
645
|
}
|
|
945
|
-
}, "Signature Pad")
|
|
946
|
-
className: "col-*-*"
|
|
947
|
-
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
646
|
+
}, "Signature Pad"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
948
647
|
variant: "contained",
|
|
949
648
|
component: "span",
|
|
950
649
|
className: paletteSelectionId === 'TEXT_ITEM' ? classes.paletteButtonSelected : classes.paletteButton,
|
|
951
|
-
onClick: () => {
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
650
|
+
onClick: () => grabPalleteItem({
|
|
651
|
+
id: idCounter.current++,
|
|
652
|
+
description: 'Text',
|
|
653
|
+
type: 'TEXT_ITEM',
|
|
654
|
+
props: TEXT_ITEM
|
|
655
|
+
}),
|
|
656
|
+
id: "initialPaletteButton",
|
|
957
657
|
classes: {
|
|
958
658
|
"label": "paletteButtonLabel"
|
|
959
659
|
}
|
|
960
|
-
}, "Text Input")
|
|
961
|
-
className: "col-*-*"
|
|
962
|
-
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
660
|
+
}, "Text Input"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
963
661
|
variant: "contained",
|
|
964
662
|
component: "span",
|
|
965
663
|
className: classes.paletteButton,
|
|
@@ -970,7 +668,7 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
970
668
|
classes: {
|
|
971
669
|
"label": "paletteButtonLabel"
|
|
972
670
|
}
|
|
973
|
-
}, "Clear")
|
|
671
|
+
}, "Clear"), /*#__PURE__*/_react.default.createElement("div", {
|
|
974
672
|
className: "".concat(classes.propertyWindow)
|
|
975
673
|
}, /*#__PURE__*/_react.default.createElement(_SignatureInputProps.default, {
|
|
976
674
|
value: selectedInputBoxValue,
|
|
@@ -979,20 +677,32 @@ const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
979
677
|
deleteHandler: (id, values) => deleteInputItem(id, values),
|
|
980
678
|
dublicateHandler: id => handleDuplicate(id)
|
|
981
679
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
680
|
+
style: {
|
|
681
|
+
border: "1px solid #e1e1e1",
|
|
682
|
+
borderRadius: "4px",
|
|
683
|
+
marginLeft: "8px",
|
|
684
|
+
height: "100%",
|
|
685
|
+
width: "calc(100% - 288px)"
|
|
686
|
+
},
|
|
687
|
+
className: 'col-*-*',
|
|
688
|
+
onClick: e => mouseClickHandler(e)
|
|
689
|
+
}, templateDoc ? /*#__PURE__*/_react.default.createElement("div", {
|
|
982
690
|
style: {
|
|
983
691
|
maxHeight: "calc(70vh - 80px)",
|
|
984
|
-
overflow: "auto"
|
|
985
|
-
width: "60%"
|
|
692
|
+
overflow: "auto"
|
|
986
693
|
},
|
|
987
694
|
className: 'col-*-*',
|
|
988
|
-
id: "signaturePanel",
|
|
989
|
-
onClick: e => mouseClickHandler(e),
|
|
990
|
-
onMouseOver: e => mouseOverHandler(e),
|
|
991
|
-
onMouseOut: e => mouseOutHandler(e),
|
|
992
695
|
id: "templateContainer"
|
|
993
696
|
}, /*#__PURE__*/_react.default.createElement(_reactHtmlRenderer.default, {
|
|
994
|
-
html:
|
|
995
|
-
}))
|
|
697
|
+
html: templateDoc.replace('<html', "<div name=\"replaced_html\"").replace('</html>', '</div>').replace('<body', "<div name=\"replaced_body\"").replace('</body>', '</div>')
|
|
698
|
+
})) : /*#__PURE__*/_react.default.createElement("div", {
|
|
699
|
+
style: {
|
|
700
|
+
width: '100%',
|
|
701
|
+
display: 'inline-block',
|
|
702
|
+
textAlign: 'center',
|
|
703
|
+
marginTop: '64px'
|
|
704
|
+
}
|
|
705
|
+
}, "no template to display"))) : null)) : /*#__PURE__*/_react.default.createElement("div", null, "Loading..."));
|
|
996
706
|
}));
|
|
997
707
|
|
|
998
708
|
var _default = SignatureTemplateDesigner;
|