@agilemotion/oui-react-js 1.6.4 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApplicationManager.js +675 -1044
- package/dist/BasicApp.js +9 -27
- package/dist/BasicAppHome.js +27 -101
- package/dist/DynamicJS.js +109 -197
- package/dist/InteractionPortalApp.js +7 -27
- package/dist/InteractionPortalAppHome.js +21 -87
- package/dist/InteractionPortalApp_old.js +60 -122
- package/dist/RestUtils.js +269 -410
- package/dist/TypedValue.js +20 -26
- package/dist/Utils.js +295 -481
- package/dist/WithRouter.js +9 -17
- package/dist/assets/jss/components/authNavbarStyle.js +168 -171
- package/dist/assets/jss/components/buttonStyle.js +2 -5
- package/dist/assets/jss/components/cardAvatarStyle.js +2 -5
- package/dist/assets/jss/components/cardBodyStyle.js +2 -5
- package/dist/assets/jss/components/cardFooterStyle.js +2 -5
- package/dist/assets/jss/components/cardHeaderStyle.js +20 -17
- package/dist/assets/jss/components/cardIconStyle.js +2 -5
- package/dist/assets/jss/components/cardStyle.js +2 -5
- package/dist/assets/jss/components/cardTextStyle.js +2 -5
- package/dist/assets/jss/components/customDropdownStyle.js +171 -173
- package/dist/assets/jss/components/customInputStyle.js +5 -13
- package/dist/assets/jss/components/dropdownStyle.js +71 -74
- package/dist/assets/jss/components/footerStyle.js +14 -23
- package/dist/assets/jss/components/headerLinksStyle.js +52 -53
- package/dist/assets/jss/components/headerStyle.js +68 -73
- package/dist/assets/jss/components/navbarLinksStyle.js +81 -74
- package/dist/assets/jss/components/navbarStyle.js +79 -84
- package/dist/assets/jss/components/sidebarStyle.js +438 -441
- package/dist/assets/jss/components/typographyStyle.js +5 -13
- package/dist/assets/jss/rootStyle.js +85 -151
- package/dist/assets/jss/views/layoutStyle.js +45 -51
- package/dist/assets/jss/views/loginBasicStyle.js +2 -5
- package/dist/assets/jss/views/loginBusinessPortalStyle.js +2 -5
- package/dist/assets/jss/views/loginStyle.js +80 -87
- package/dist/components/AlertBar.js +20 -75
- package/dist/components/AlertItem.js +13 -49
- package/dist/components/AlertTemplate.js +12 -18
- package/dist/components/Button.js +41 -112
- package/dist/components/Calendar.js +99 -208
- package/dist/components/ConfirmationDialog.js +13 -54
- package/dist/components/DataGrid.js +271 -695
- package/dist/components/DataGridColumn.js +24 -74
- package/dist/components/DataGridFilter.js +107 -245
- package/dist/components/DataGridHeading.js +34 -78
- package/dist/components/Dialog.js +37 -130
- package/dist/components/DocumentTemplateDesigner.js +16 -57
- package/dist/components/DocumentTemplateDesignerComponent.js +47 -141
- package/dist/components/DocumentTemplatePlaceholderDialog.js +34 -67
- package/dist/components/DocumentViewer.js +25 -65
- package/dist/components/DocumentViewerComponent.js +13 -44
- package/dist/components/ElementResizeHandler.js +148 -200
- package/dist/components/FileThumb.js +15 -56
- package/dist/components/Graph.js +98 -203
- package/dist/components/GraphNode.js +20 -61
- package/dist/components/HtmlPanel.js +38 -105
- package/dist/components/Icon.js +174 -253
- package/dist/components/LoadingIndicator.js +4 -11
- package/dist/components/LottieIcon.js +63 -60
- package/dist/components/PopupView.js +21 -60
- package/dist/components/Portlet.js +18 -60
- package/dist/components/RegularButton.js +34 -42
- package/dist/components/SignaturePanel.js +19 -67
- package/dist/components/SocketManager.js +133 -228
- package/dist/components/StepperTitleBar.js +48 -99
- package/dist/components/TabPage.js +30 -47
- package/dist/components/TabPanel.js +35 -122
- package/dist/components/TableCellContent.js +34 -98
- package/dist/components/TemplateDesigner.js +115 -230
- package/dist/components/TemplateItemEventHandler.js +298 -481
- package/dist/components/TemplateTable.js +117 -218
- package/dist/components/TitleBar.js +15 -53
- package/dist/components/Toolbar.js +44 -110
- package/dist/components/Tooltip.js +37 -56
- package/dist/components/Tree.js +50 -143
- package/dist/components/UseIsVisible.js +5 -25
- package/dist/components/card/Card.js +35 -39
- package/dist/components/card/CardAvatar.js +21 -32
- package/dist/components/card/CardBody.js +29 -36
- package/dist/components/card/CardFooter.js +26 -35
- package/dist/components/card/CardHeader.js +29 -36
- package/dist/components/card/CardIcon.js +15 -29
- package/dist/components/card/CardText.js +15 -29
- package/dist/components/customInput/CustomInput.js +38 -40
- package/dist/components/dashboard/FoldingSideTabDashboard.js +65 -184
- package/dist/components/dashboard/SideMenuModuleDashboard.js +67 -185
- package/dist/components/dashboard/TopMenuModuleDashboard.js +22 -63
- package/dist/components/dashboard/components/Header.js +15 -52
- package/dist/components/dashboard/components/LeftDrawer.js +9 -23
- package/dist/components/dashboard/components/UserIdentity.js +4 -12
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +115 -155
- package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +344 -419
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +15 -29
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +405 -485
- package/dist/components/dashboard/components/portal/Timeline.js +3 -8
- package/dist/components/dashboard/components/portal/Workspace.js +4 -13
- package/dist/components/footer/Footer.js +23 -45
- package/dist/components/footer/HomeFooter.js +38 -78
- package/dist/components/form/AddressSearch.js +26 -76
- package/dist/components/form/AutoComplete.js +54 -168
- package/dist/components/form/BaseField.js +59 -189
- package/dist/components/form/Checkbox.js +11 -24
- package/dist/components/form/DatePicker.js +28 -82
- package/dist/components/form/FieldSet.js +84 -300
- package/dist/components/form/Form.js +206 -501
- package/dist/components/form/GridField.js +83 -243
- package/dist/components/form/IconField.js +10 -21
- package/dist/components/form/ImageEditor.js +98 -208
- package/dist/components/form/LabelField.js +13 -28
- package/dist/components/form/LookupField.js +36 -102
- package/dist/components/form/MultiFileUploadField.js +67 -134
- package/dist/components/form/RadioGroup.js +20 -57
- package/dist/components/form/Section.js +33 -118
- package/dist/components/form/SelectItem.js +36 -83
- package/dist/components/form/SignatureTemplateDesignerField.js +12 -26
- package/dist/components/form/Switch.js +11 -24
- package/dist/components/form/TextField.js +19 -55
- package/dist/components/form/TimePicker.js +18 -43
- package/dist/components/form/TransferList.js +76 -200
- package/dist/components/form/UploadField.js +134 -256
- package/dist/components/grid/GridContainer.js +10 -23
- package/dist/components/grid/GridItem.js +10 -23
- package/dist/components/layout/CollapsiblePanel.js +20 -59
- package/dist/components/layout/Layout.js +40 -149
- package/dist/components/layout/View.js +65 -195
- package/dist/components/layout/ViewContainer.js +13 -33
- package/dist/components/layout/ViewPort.js +14 -48
- package/dist/components/layout/Window.js +62 -135
- package/dist/components/layout/WindowViewPort.js +18 -63
- package/dist/components/media/ClosablePanel.js +9 -18
- package/dist/components/media/LobbyWaitingList.js +11 -17
- package/dist/components/media/MediaSoupHelper.js +173 -401
- package/dist/components/media/SideBarContent.js +17 -34
- package/dist/components/media/SocketRequest.js +7 -18
- package/dist/components/media/SocketResponse.js +5 -14
- package/dist/components/media/Timer.js +18 -54
- package/dist/components/media/Toolbar.js +97 -254
- package/dist/components/media/ToolbarButton.js +34 -95
- package/dist/components/media/Toolbar_bck.js +70 -186
- package/dist/components/media/Tracks.js +19 -33
- package/dist/components/media/TrainingRoom.js +121 -374
- package/dist/components/media/Transports.js +17 -29
- package/dist/components/media/VCEventManager.js +45 -116
- package/dist/components/media/VCEventType.js +82 -168
- package/dist/components/media/VCParticipantList.js +16 -51
- package/dist/components/media/VCParticipantListItem.js +44 -141
- package/dist/components/media/VCRoom.js +14 -58
- package/dist/components/media/VCRoomParticipant.js +235 -556
- package/dist/components/media/VCRoomRecorder.js +106 -204
- package/dist/components/media/VCRoomWorkspace.js +248 -584
- package/dist/components/media/Video.js +27 -112
- package/dist/components/media/VideoPlayer.js +23 -91
- package/dist/components/media/chat/ChatRoom.js +143 -361
- package/dist/components/media/chat/ChatRoomItem.js +17 -58
- package/dist/components/media/chat/ChatRoomList.js +15 -60
- package/dist/components/menu/CollapsibleMenu.js +22 -52
- package/dist/components/menu/MenuBars.js +50 -116
- package/dist/components/menu/MenuButton.js +53 -130
- package/dist/components/menu/MenuItem.js +11 -51
- package/dist/components/menu/MenuLink.js +13 -41
- package/dist/components/menu/PopupMenu.js +13 -25
- package/dist/components/navbars/AuthNavbar.js +21 -56
- package/dist/components/navbars/HomeNavbar.js +213 -290
- package/dist/components/navbars/PortalNavbar.js +26 -81
- package/dist/components/signatures/AgilitySignaturePanel.js +41 -135
- package/dist/components/signatures/AlertItem.js +14 -50
- package/dist/components/signatures/Card.js +6 -16
- package/dist/components/signatures/DocumentContainer.js +57 -165
- package/dist/components/signatures/ImageSignatureInput.js +64 -124
- package/dist/components/signatures/MenuButton.js +28 -63
- package/dist/components/signatures/Prompt.js +6 -41
- package/dist/components/signatures/ResponsiveTable.js +181 -370
- package/dist/components/signatures/SearchView.js +34 -112
- package/dist/components/signatures/SignatorySearch.js +11 -44
- package/dist/components/signatures/SignatorySearchForm.js +19 -50
- package/dist/components/signatures/SignatureInput.js +28 -91
- package/dist/components/signatures/SignatureInputProps.js +49 -144
- package/dist/components/signatures/SignatureTemplateDesigner.js +230 -430
- package/dist/components/signatures/Toolbar.js +99 -173
- package/dist/components/signatures/ViewUtils.js +207 -313
- package/dist/components/typography/Danger.js +6 -11
- package/dist/components/typography/Info.js +7 -11
- package/dist/components/typography/Link.js +6 -12
- package/dist/event/ActionHandlers.js +48 -87
- package/dist/event/Event.js +21 -25
- package/dist/event/EventListener.js +54 -48
- package/dist/event/EventType.js +18 -40
- package/dist/event/LoadDataActionHandler.js +10 -31
- package/dist/event/Observable.js +204 -396
- package/dist/event/RouteActionHandler.js +119 -171
- package/dist/event/ScriptActionHandler.js +10 -32
- package/dist/event/ServiceCallActionHandler.js +37 -64
- package/dist/event/SignalGraphActionHandler.js +9 -31
- package/dist/js/Addresses.js +23 -42
- package/dist/js/Calendar.js +41 -89
- package/dist/js/DynamicLib.js +11 -23
- package/dist/js/Media.js +80 -174
- package/dist/js/Validators.js +6 -12
- package/dist/js/Windows.js +22 -40
- package/dist/redux/store/ConfigureStore.js +12 -29
- package/dist/redux/store/DashboardStore.js +47 -120
- package/dist/redux/store/History.js +2 -5
- package/dist/redux/store/SecurityStore.js +22 -65
- package/dist/security/TokenManager.js +29 -53
- package/dist/theme-default.js +3 -8
- package/dist/view/Dashboard.js +140 -308
- package/dist/view/PortalDashboard.js +6 -13
- package/dist/view/Settings.js +3 -11
- package/dist/view/Views.js +15 -35
- package/dist/view/security/ChangePasswordBasic.js +41 -147
- package/dist/view/security/ForgotPassword.js +26 -106
- package/dist/view/security/ForgotPasswordBasic.js +22 -96
- package/dist/view/security/Login.js +29 -117
- package/dist/view/security/LoginBasic.js +28 -108
- package/dist/view/security/LoginInteractionPortal.js +28 -106
- package/dist/view/security/ResetPassword.js +25 -110
- package/dist/view/security/ResetPasswordBasic.js +39 -142
- package/dist/view/security/Security.js +14 -26
- package/package.json +25 -20
|
@@ -1,302 +1,201 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
7
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
8
|
var _Utils = _interopRequireDefault(require("../../Utils"));
|
|
13
|
-
|
|
14
9
|
var _reactHtmlRenderer = _interopRequireDefault(require("react-html-renderer"));
|
|
15
|
-
|
|
16
10
|
var _core = require("@material-ui/core");
|
|
17
|
-
|
|
18
11
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
19
|
-
|
|
20
12
|
var _ApplicationManager = _interopRequireDefault(require("../../ApplicationManager"));
|
|
21
|
-
|
|
22
13
|
var _reactPromiseTracker = require("react-promise-tracker");
|
|
23
|
-
|
|
24
14
|
var _SignatureInputProps = _interopRequireDefault(require("./SignatureInputProps"));
|
|
25
|
-
|
|
26
15
|
var _Observable = _interopRequireDefault(require("../../event/Observable"));
|
|
27
|
-
|
|
28
16
|
var _Event = _interopRequireDefault(require("../../event/Event"));
|
|
29
|
-
|
|
30
17
|
var _EventType = _interopRequireDefault(require("../../event/EventType"));
|
|
31
|
-
|
|
32
18
|
var Base64 = _interopRequireWildcard(require("js-base64"));
|
|
33
|
-
|
|
34
19
|
var _RestUtils = require("../../RestUtils");
|
|
35
|
-
|
|
36
20
|
var _ServiceCallActionHandler = _interopRequireDefault(require("../../event/ServiceCallActionHandler"));
|
|
37
|
-
|
|
38
21
|
var _TemplateItemEventHandler = _interopRequireDefault(require("../TemplateItemEventHandler"));
|
|
39
|
-
|
|
40
22
|
require("../TemplateDesigner.css");
|
|
41
|
-
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
47
|
-
|
|
48
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
49
|
-
|
|
50
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
51
|
-
|
|
52
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
53
|
-
|
|
54
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
55
|
-
|
|
56
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
57
|
-
|
|
58
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
59
|
-
|
|
60
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
61
|
-
|
|
62
|
-
var INITIAL_ITEM = {
|
|
23
|
+
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
|
+
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
26
|
+
const INITIAL_ITEM = {
|
|
63
27
|
defaultWidthOnPageDrop: 80,
|
|
64
28
|
defaultHeightOnPageDrop: 80
|
|
65
29
|
};
|
|
66
|
-
|
|
30
|
+
const SIGN_ITEM = {
|
|
67
31
|
defaultWidthOnPageDrop: 200,
|
|
68
32
|
defaultHeightOnPageDrop: 80
|
|
69
33
|
};
|
|
70
|
-
|
|
34
|
+
const TEXT_ITEM = {
|
|
71
35
|
defaultWidthOnPageDrop: 200,
|
|
72
36
|
defaultHeightOnPageDrop: 80
|
|
73
37
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
38
|
+
const DROP_ITEM_MARGIN = 32;
|
|
39
|
+
const types = [INITIAL_ITEM, SIGN_ITEM, TEXT_ITEM];
|
|
40
|
+
const useStyles = (0, _core.makeStyles)(theme => ({
|
|
41
|
+
button: {
|
|
42
|
+
margin: theme.spacing(1)
|
|
43
|
+
},
|
|
44
|
+
input: {
|
|
45
|
+
display: 'none'
|
|
46
|
+
},
|
|
47
|
+
errorMessageDisplay: {
|
|
48
|
+
color: 'red'
|
|
49
|
+
},
|
|
50
|
+
propertyWindow: {
|
|
51
|
+
height: '400px',
|
|
52
|
+
margin: '4px',
|
|
53
|
+
borderRadius: '4px',
|
|
54
|
+
paddingLeft: '24px',
|
|
55
|
+
borderBottom: '1px solid #e1e1e1',
|
|
56
|
+
borderTop: '1px solid #e1e1e1'
|
|
57
|
+
},
|
|
58
|
+
paletteButton: {
|
|
59
|
+
width: '270px',
|
|
60
|
+
height: '40px',
|
|
61
|
+
backgroundColor: '#e1e1e1',
|
|
62
|
+
margin: '4px',
|
|
63
|
+
textAlign: 'center',
|
|
64
|
+
padding: '28px 0',
|
|
65
|
+
borderRadius: '4px',
|
|
66
|
+
cursor: 'grabbing'
|
|
67
|
+
},
|
|
68
|
+
paletteButtonSelected: {
|
|
69
|
+
'&:hover': {
|
|
70
|
+
backgroundColor: 'yellowgreen'
|
|
80
71
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
height: '40px',
|
|
98
|
-
backgroundColor: '#e1e1e1',
|
|
99
|
-
margin: '4px',
|
|
100
|
-
textAlign: 'center',
|
|
101
|
-
padding: '28px 0',
|
|
102
|
-
borderRadius: '4px',
|
|
103
|
-
cursor: 'grabbing'
|
|
104
|
-
},
|
|
105
|
-
paletteButtonSelected: {
|
|
106
|
-
'&:hover': {
|
|
107
|
-
backgroundColor: 'yellowgreen'
|
|
108
|
-
},
|
|
109
|
-
width: '270px',
|
|
110
|
-
height: '40px',
|
|
111
|
-
backgroundColor: 'yellowgreen',
|
|
112
|
-
margin: '4px',
|
|
113
|
-
textAlign: 'center',
|
|
114
|
-
padding: '28px 0',
|
|
115
|
-
borderRadius: '4px',
|
|
116
|
-
cursor: 'grabbing'
|
|
117
|
-
},
|
|
118
|
-
palette: {
|
|
119
|
-
width: '280px',
|
|
120
|
-
borderRadius: '4px',
|
|
121
|
-
border: '1px solid #e1e1e1'
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
var status = function status(response) {
|
|
72
|
+
width: '270px',
|
|
73
|
+
height: '40px',
|
|
74
|
+
backgroundColor: 'yellowgreen',
|
|
75
|
+
margin: '4px',
|
|
76
|
+
textAlign: 'center',
|
|
77
|
+
padding: '28px 0',
|
|
78
|
+
borderRadius: '4px',
|
|
79
|
+
cursor: 'grabbing'
|
|
80
|
+
},
|
|
81
|
+
palette: {
|
|
82
|
+
width: '280px',
|
|
83
|
+
borderRadius: '4px',
|
|
84
|
+
border: '1px solid #e1e1e1'
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
87
|
+
const status = response => {
|
|
127
88
|
if (response.ok) {
|
|
128
89
|
return Promise.resolve(response);
|
|
129
90
|
} else {
|
|
130
|
-
|
|
91
|
+
let error = new Error(response.statusText);
|
|
131
92
|
error.code = response.status;
|
|
132
93
|
return Promise.reject(error);
|
|
133
94
|
}
|
|
134
95
|
};
|
|
135
|
-
|
|
136
|
-
var json = function json(response) {
|
|
96
|
+
const json = response => {
|
|
137
97
|
return response.text();
|
|
138
98
|
};
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
157
|
-
paletteSelectionId = _React$useState6[0],
|
|
158
|
-
setPaletteSelectionId = _React$useState6[1];
|
|
159
|
-
|
|
160
|
-
var paletteSelection = _react.default.useRef(null);
|
|
161
|
-
|
|
162
|
-
var idCounter = _react.default.useRef(0);
|
|
163
|
-
|
|
164
|
-
var _React$useState7 = _react.default.useState(null),
|
|
165
|
-
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
166
|
-
value = _React$useState8[0],
|
|
167
|
-
setValue = _React$useState8[1];
|
|
168
|
-
|
|
169
|
-
var _React$useState9 = _react.default.useState(null),
|
|
170
|
-
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
171
|
-
selectedInputBoxValue = _React$useState10[0],
|
|
172
|
-
setSelectedInputBoxValue = _React$useState10[1];
|
|
173
|
-
|
|
174
|
-
var _React$useState11 = _react.default.useState([]),
|
|
175
|
-
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
176
|
-
inputBoxValues = _React$useState12[0],
|
|
177
|
-
setInputBoxValues = _React$useState12[1];
|
|
178
|
-
|
|
179
|
-
var classes = useStyles();
|
|
180
|
-
|
|
181
|
-
var _React$useState13 = _react.default.useState(_Utils.default.isNull(props.autoLoadData) || props.autoLoadData === true),
|
|
182
|
-
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
183
|
-
loading = _React$useState14[0],
|
|
184
|
-
setLoading = _React$useState14[1];
|
|
185
|
-
|
|
186
|
-
var documentName = _react.default.useRef(null);
|
|
187
|
-
|
|
188
|
-
var _React$useState15 = _react.default.useState(null),
|
|
189
|
-
_React$useState16 = _slicedToArray(_React$useState15, 2),
|
|
190
|
-
grabbedItem = _React$useState16[0],
|
|
191
|
-
setGrabbedItem = _React$useState16[1];
|
|
192
|
-
|
|
193
|
-
_react.default.useEffect(function () {
|
|
99
|
+
const location = window.location.protocol + '//' + window.location.hostname;
|
|
100
|
+
const templateItemEventHandler = new _TemplateItemEventHandler.default();
|
|
101
|
+
const VALID_COLOR = 'green';
|
|
102
|
+
const SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
103
|
+
const [file, setFile] = _react.default.useState(null);
|
|
104
|
+
const [templateDoc, setTemplateDoc] = _react.default.useState(null);
|
|
105
|
+
const [paletteSelectionId, setPaletteSelectionId] = _react.default.useState(null);
|
|
106
|
+
const paletteSelection = _react.default.useRef(null);
|
|
107
|
+
const idCounter = _react.default.useRef(0);
|
|
108
|
+
const [value, setValue] = _react.default.useState(null);
|
|
109
|
+
const [selectedInputBoxValue, setSelectedInputBoxValue] = _react.default.useState(null);
|
|
110
|
+
const [inputBoxValues, setInputBoxValues] = _react.default.useState([]);
|
|
111
|
+
const classes = useStyles();
|
|
112
|
+
const [loading, setLoading] = _react.default.useState(_Utils.default.isNull(props.autoLoadData) || props.autoLoadData === true);
|
|
113
|
+
const documentName = _react.default.useRef(null);
|
|
114
|
+
const [grabbedItem, setGrabbedItem] = _react.default.useState(null);
|
|
115
|
+
_react.default.useEffect(() => {
|
|
194
116
|
props.handle.api = api();
|
|
195
117
|
});
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
var parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
199
|
-
|
|
118
|
+
_react.default.useEffect(() => {
|
|
119
|
+
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
200
120
|
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
|
|
201
|
-
|
|
202
121
|
_Observable.default.addSystemSubscriptions(props.viewId, parsedConfig);
|
|
203
122
|
}, []);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
var container = document.getElementById('templateContainer');
|
|
207
|
-
|
|
123
|
+
const setup = () => {
|
|
124
|
+
let container = document.getElementById('templateContainer');
|
|
208
125
|
if (!_Utils.default.isNull(templateDoc) && !_Utils.default.isNull(container)) {
|
|
209
|
-
templateItemEventHandler.initDragAndDrop(
|
|
126
|
+
templateItemEventHandler.initDragAndDrop(id => {}, container);
|
|
210
127
|
}
|
|
211
128
|
};
|
|
212
|
-
|
|
213
|
-
_react.default.useEffect(function () {
|
|
129
|
+
_react.default.useEffect(() => {
|
|
214
130
|
setup();
|
|
215
131
|
}, []);
|
|
216
|
-
|
|
217
|
-
_react.default.useEffect(function () {
|
|
132
|
+
_react.default.useEffect(() => {
|
|
218
133
|
setup();
|
|
219
134
|
}, [templateDoc]);
|
|
220
|
-
|
|
221
|
-
_react.default.useEffect(function () {
|
|
135
|
+
_react.default.useEffect(() => {
|
|
222
136
|
if (!_Utils.default.isNull(props.valueChangeHandler)) {
|
|
223
137
|
props.valueChangeHandler(value);
|
|
224
138
|
}
|
|
225
139
|
}, [value]);
|
|
226
|
-
|
|
227
|
-
var api = function api() {
|
|
140
|
+
const api = () => {
|
|
228
141
|
return {
|
|
229
142
|
get id() {
|
|
230
143
|
return props.config.id;
|
|
231
144
|
},
|
|
232
|
-
|
|
233
|
-
loadData: function loadData(actionConfig) {
|
|
145
|
+
loadData: actionConfig => {
|
|
234
146
|
setLoading(true);
|
|
235
|
-
|
|
236
|
-
|
|
147
|
+
let service = !_Utils.default.isNull(props.config.dataService) ? props.config.dataService : !_Utils.default.isNull(actionConfig) !== null ? actionConfig.dataService : null;
|
|
237
148
|
if (!_Utils.default.isNull(service)) {
|
|
238
149
|
if (service.type === 'rpc') {
|
|
239
|
-
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId,
|
|
150
|
+
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId, result => {
|
|
240
151
|
setLoading(false);
|
|
241
|
-
},
|
|
152
|
+
}, e => {
|
|
242
153
|
console.error(e);
|
|
243
|
-
|
|
244
154
|
_Utils.default.publishErrorMessage(e, props.viewId);
|
|
245
|
-
},
|
|
155
|
+
}, parameter => {
|
|
246
156
|
setLoading(false);
|
|
247
157
|
});
|
|
248
158
|
} else {
|
|
249
159
|
if (_Utils.default.isNull(actionConfig)) {
|
|
250
160
|
actionConfig = {};
|
|
251
161
|
}
|
|
252
|
-
|
|
253
162
|
actionConfig.service = service;
|
|
254
|
-
|
|
255
|
-
_ServiceCallActionHandler.default.execute(actionConfig, null, null, props.viewId, function (data) {
|
|
163
|
+
_ServiceCallActionHandler.default.execute(actionConfig, null, null, props.viewId, data => {
|
|
256
164
|
setTemplateDoc(data.template);
|
|
257
165
|
setLoading(false);
|
|
258
|
-
},
|
|
166
|
+
}, () => {});
|
|
259
167
|
}
|
|
260
|
-
|
|
261
168
|
return true;
|
|
262
169
|
} else {
|
|
263
170
|
if (!_Utils.default.isNull(actionConfig) && !_Utils.default.isNull(actionConfig.value)) {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
setInputBoxValues(_value.signatureInputs);
|
|
271
|
-
idCounter.current = _value.idCounter;
|
|
171
|
+
let value = _ApplicationManager.default.isExpression(actionConfig.value) ? _ApplicationManager.default.resolveExpressionValue(actionConfig.value) : actionConfig.value;
|
|
172
|
+
setValue(value);
|
|
173
|
+
if (!_Utils.default.isNull(value)) {
|
|
174
|
+
setTemplateDoc(value.htmlTemplate);
|
|
175
|
+
setInputBoxValues(value.signatureInputs);
|
|
176
|
+
idCounter.current = value.idCounter;
|
|
272
177
|
}
|
|
273
178
|
}
|
|
274
|
-
|
|
275
179
|
setLoading(false);
|
|
276
180
|
}
|
|
277
181
|
},
|
|
278
|
-
|
|
279
182
|
get model() {
|
|
280
183
|
return value;
|
|
281
184
|
},
|
|
282
|
-
|
|
283
185
|
get value() {
|
|
284
186
|
return value;
|
|
285
187
|
}
|
|
286
|
-
|
|
287
188
|
};
|
|
288
189
|
};
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
var inputValue = {};
|
|
190
|
+
const newItem = (id, width, height) => {
|
|
191
|
+
let inputValue = {};
|
|
292
192
|
inputValue.id = id;
|
|
293
193
|
inputValue.height = height.replace('px', '');
|
|
294
194
|
inputValue.width = width.replace('px', '');
|
|
295
195
|
inputValue.type = paletteSelection.current === 'INITIAL_ITEM' ? 'INITIAL' : paletteSelection.current === 'SIGN_ITEM' ? 'SIGN' : 'TEXT INPUT';
|
|
296
196
|
return inputValue;
|
|
297
197
|
};
|
|
298
|
-
|
|
299
|
-
var mouseClickHandler = function mouseClickHandler(event) {
|
|
198
|
+
let mouseClickHandler = function (event) {
|
|
300
199
|
if (grabbedItem) {
|
|
301
200
|
setValue(null);
|
|
302
201
|
setSelectedInputBoxValue(null);
|
|
@@ -306,241 +205,160 @@ var SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_
|
|
|
306
205
|
height: grabbedItem.props.defaultHeightOnPageDrop,
|
|
307
206
|
description: grabbedItem.description,
|
|
308
207
|
type: grabbedItem.type
|
|
309
|
-
},
|
|
310
|
-
|
|
311
|
-
|
|
208
|
+
}, (id, node) => {
|
|
209
|
+
let inputValue = getInputValue(id);
|
|
312
210
|
if (!inputValue) {
|
|
313
211
|
inputValue = newItem(id, node.style.width, node.style.height);
|
|
314
212
|
inputBoxValues.push(inputValue);
|
|
315
213
|
}
|
|
316
|
-
|
|
317
214
|
saveValue();
|
|
318
215
|
setSelectedInputBoxValue(inputValue);
|
|
319
216
|
});
|
|
320
217
|
}
|
|
321
|
-
|
|
322
218
|
setPaletteSelectionId(null);
|
|
323
219
|
setGrabbedItem(null);
|
|
324
220
|
};
|
|
325
|
-
|
|
326
|
-
var grabPalleteItem = function grabPalleteItem(item) {
|
|
221
|
+
const grabPalleteItem = item => {
|
|
327
222
|
document.getElementsByTagName('body')[0].style.cursor = 'grabbing';
|
|
328
223
|
setPaletteSelectionId(item.type);
|
|
329
224
|
paletteSelection.current = item.type;
|
|
330
225
|
setGrabbedItem(item);
|
|
331
226
|
};
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
var event = new _Event.default(props.handle, props.viewId, value);
|
|
335
|
-
|
|
227
|
+
_react.default.useEffect(() => {
|
|
228
|
+
let event = new _Event.default(props.handle, props.viewId, value);
|
|
336
229
|
_Observable.default.fireEvent(_EventType.default.VALUE_CHANGE, event);
|
|
337
230
|
}, [value]);
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
try {
|
|
346
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
347
|
-
var inputBoxValue = _step.value;
|
|
348
|
-
|
|
349
|
-
if (inputBoxValue.id === id) {
|
|
350
|
-
inputBoxValue.index = index;
|
|
351
|
-
return inputBoxValue;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
index++;
|
|
231
|
+
const getInputValue = id => {
|
|
232
|
+
let index = 0;
|
|
233
|
+
for (const inputBoxValue of inputBoxValues) {
|
|
234
|
+
if (inputBoxValue.id === id) {
|
|
235
|
+
inputBoxValue.index = index;
|
|
236
|
+
return inputBoxValue;
|
|
355
237
|
}
|
|
356
|
-
|
|
357
|
-
_iterator.e(err);
|
|
358
|
-
} finally {
|
|
359
|
-
_iterator.f();
|
|
238
|
+
index++;
|
|
360
239
|
}
|
|
361
|
-
|
|
362
240
|
return null;
|
|
363
241
|
};
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
},
|
|
381
|
-
body: data
|
|
382
|
-
};
|
|
383
|
-
var url = location + _ApplicationManager.default.getContextRoot() + props.config.documentConverterUrl;
|
|
384
|
-
(0, _reactPromiseTracker.trackPromise)(fetch(encodeURI(url), fetchConfig).then(status).then(json).then(function (data) {
|
|
385
|
-
setTemplateDoc(data);
|
|
386
|
-
setFile(null);
|
|
387
|
-
}).catch(function (e) {
|
|
388
|
-
if (e.code === 401) {
|
|
389
|
-
_ApplicationManager.default.clear();
|
|
390
|
-
|
|
391
|
-
_ApplicationManager.default.getApplicationHistory().push('/login');
|
|
392
|
-
}
|
|
393
|
-
}));
|
|
242
|
+
const handleSubmit = () => event => {
|
|
243
|
+
setTemplateDoc('');
|
|
244
|
+
const accessToken = sessionStorage.getItem('accessToken');
|
|
245
|
+
const idToken = sessionStorage.getItem('idToken');
|
|
246
|
+
let data = new FormData();
|
|
247
|
+
data.append('sourceType', 'PDF');
|
|
248
|
+
data.append('targetType', 'HTML');
|
|
249
|
+
data.append('file', file);
|
|
250
|
+
let fetchConfig = {
|
|
251
|
+
method: 'POST',
|
|
252
|
+
headers: {
|
|
253
|
+
'Accept': 'application/json',
|
|
254
|
+
'Authorization': 'Bearer ' + accessToken,
|
|
255
|
+
'idToken': idToken
|
|
256
|
+
},
|
|
257
|
+
body: data
|
|
394
258
|
};
|
|
259
|
+
let url = location + _ApplicationManager.default.getContextRoot() + props.config.documentConverterUrl;
|
|
260
|
+
(0, _reactPromiseTracker.trackPromise)(fetch(encodeURI(url), fetchConfig).then(status).then(json).then(data => {
|
|
261
|
+
setTemplateDoc(data);
|
|
262
|
+
setFile(null);
|
|
263
|
+
}).catch(e => {
|
|
264
|
+
if (e.code === 401) {
|
|
265
|
+
_ApplicationManager.default.clear();
|
|
266
|
+
_ApplicationManager.default.getApplicationHistory().push('/login');
|
|
267
|
+
}
|
|
268
|
+
}));
|
|
395
269
|
};
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
documentName.current = files[0].name;
|
|
401
|
-
setFile(files[0]);
|
|
402
|
-
};
|
|
270
|
+
const handleChange = () => event => {
|
|
271
|
+
let files = event.target.files;
|
|
272
|
+
documentName.current = files[0].name;
|
|
273
|
+
setFile(files[0]);
|
|
403
274
|
};
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
var val = getInputValue(id);
|
|
275
|
+
const deleteInputItem = id => {
|
|
276
|
+
let val = getInputValue(id);
|
|
407
277
|
inputBoxValues.splice(val.index, 1);
|
|
408
|
-
|
|
278
|
+
let element = document.getElementById(id);
|
|
409
279
|
element.remove();
|
|
410
280
|
saveValue();
|
|
411
281
|
};
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
var elements = document.getElementsByClassName('_draggable_');
|
|
415
|
-
|
|
282
|
+
const clear = () => {
|
|
283
|
+
let elements = document.getElementsByClassName('_draggable_');
|
|
416
284
|
while (elements.length > 0) {
|
|
417
285
|
elements[0].remove();
|
|
418
286
|
}
|
|
419
|
-
|
|
420
287
|
inputBoxValues.splice(0, inputBoxValues.length);
|
|
421
288
|
setValue(null);
|
|
422
289
|
};
|
|
423
|
-
|
|
424
|
-
var getProps = function getProps(type) {
|
|
290
|
+
const getProps = type => {
|
|
425
291
|
if (type === 'INITIAL_ITEM') {
|
|
426
292
|
return INITIAL_ITEM;
|
|
427
293
|
} else if (type === 'SIGN_ITEM') {
|
|
428
294
|
return SIGN_ITEM;
|
|
429
295
|
}
|
|
430
|
-
|
|
431
296
|
return TEXT_ITEM;
|
|
432
297
|
};
|
|
433
|
-
|
|
434
|
-
var handleDuplicate = function handleDuplicate(id) {
|
|
298
|
+
const handleDuplicate = id => {
|
|
435
299
|
// TODO : Fix this function
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
447
|
-
var pageElement = _step2.value;
|
|
448
|
-
var pageElementHeight = parseFloat(pageElement.style.height.replace('px', '').replace('pt', ''));
|
|
449
|
-
|
|
450
|
-
if (elementTop >= pageElementTop && elementTop < pageElementTop + pageElementHeight) {
|
|
451
|
-
elementPage = pageElement;
|
|
452
|
-
break;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
pageElementTop += pageElementHeight;
|
|
300
|
+
let element = document.getElementById(id);
|
|
301
|
+
let pageElements = document.getElementsByClassName('dropTarget');
|
|
302
|
+
let elementPage = null;
|
|
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;
|
|
456
310
|
}
|
|
457
|
-
|
|
458
|
-
_iterator2.e(err);
|
|
459
|
-
} finally {
|
|
460
|
-
_iterator2.f();
|
|
311
|
+
pageElementTop += pageElementHeight;
|
|
461
312
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}, function (id, node) {
|
|
497
|
-
var inputValue = getInputValue(id);
|
|
498
|
-
|
|
499
|
-
if (!inputValue) {
|
|
500
|
-
inputValue = newItem(item.id, node.style.width, node.style.height);
|
|
501
|
-
inputBoxValues.push(inputValue);
|
|
502
|
-
setValue(null);
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
setSelectedInputBoxValue(inputValue);
|
|
506
|
-
});
|
|
507
|
-
setGrabbedItem(null);
|
|
508
|
-
})();
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
pageNumber++;
|
|
313
|
+
let offset = elementTop - pageElementTop;
|
|
314
|
+
let pageNumber = 0;
|
|
315
|
+
let elementData = getInputValue(id);
|
|
316
|
+
for (const pageElement of pageElements) {
|
|
317
|
+
let pageElementHeight = parseFloat(pageElement.style.height.replace('px', '').replace('pt', ''));
|
|
318
|
+
if (pageElement !== elementPage) {
|
|
319
|
+
let item = {
|
|
320
|
+
id: idCounter.current++,
|
|
321
|
+
description: elementData.description,
|
|
322
|
+
type: elementData.type,
|
|
323
|
+
props: getProps(elementData.type)
|
|
324
|
+
};
|
|
325
|
+
grabPalleteItem(item);
|
|
326
|
+
let event = {
|
|
327
|
+
target: pageElement
|
|
328
|
+
};
|
|
329
|
+
templateItemEventHandler.handleGrabRelease(event, {
|
|
330
|
+
id: item.id,
|
|
331
|
+
top: pageNumber * pageElementHeight + offset,
|
|
332
|
+
left: parseFloat(element.style.left.replace('px', '')),
|
|
333
|
+
width: parseFloat(element.style.width.replace('px', '')),
|
|
334
|
+
height: parseFloat(element.style.height.replace('px', '')),
|
|
335
|
+
description: item.description,
|
|
336
|
+
type: item.type
|
|
337
|
+
}, (id, node) => {
|
|
338
|
+
let inputValue = getInputValue(id);
|
|
339
|
+
if (!inputValue) {
|
|
340
|
+
inputValue = newItem(item.id, node.style.width, node.style.height);
|
|
341
|
+
inputBoxValues.push(inputValue);
|
|
342
|
+
setValue(null);
|
|
343
|
+
}
|
|
344
|
+
setSelectedInputBoxValue(inputValue);
|
|
345
|
+
});
|
|
346
|
+
setGrabbedItem(null);
|
|
512
347
|
}
|
|
513
|
-
|
|
514
|
-
_iterator3.e(err);
|
|
515
|
-
} finally {
|
|
516
|
-
_iterator3.f();
|
|
348
|
+
pageNumber++;
|
|
517
349
|
}
|
|
518
350
|
};
|
|
519
|
-
|
|
520
351
|
function saveValue() {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
528
|
-
var inputBoxValue = _step4.value;
|
|
529
|
-
console.log('\n\n\n\nSIG VAL : ' + inputBoxValue.signatory);
|
|
530
|
-
|
|
531
|
-
if (_Utils.default.isNull(inputBoxValue.signatory)) {
|
|
532
|
-
allValid = false;
|
|
533
|
-
break;
|
|
534
|
-
}
|
|
352
|
+
let allValid = true;
|
|
353
|
+
for (const inputBoxValue of inputBoxValues) {
|
|
354
|
+
console.log('\n\n\n\nSIG VAL : ' + inputBoxValue.signatory);
|
|
355
|
+
if (_Utils.default.isNull(inputBoxValue.signatory)) {
|
|
356
|
+
allValid = false;
|
|
357
|
+
break;
|
|
535
358
|
}
|
|
536
|
-
} catch (err) {
|
|
537
|
-
_iterator4.e(err);
|
|
538
|
-
} finally {
|
|
539
|
-
_iterator4.f();
|
|
540
359
|
}
|
|
541
|
-
|
|
542
360
|
if (allValid) {
|
|
543
|
-
|
|
361
|
+
let newValue = {};
|
|
544
362
|
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');
|
|
545
363
|
newValue.htmlTemplateBase64 = Base64.encode(newValue.htmlTemplate);
|
|
546
364
|
newValue.signatureInputs = inputBoxValues;
|
|
@@ -551,14 +369,13 @@ var SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_
|
|
|
551
369
|
setValue(null);
|
|
552
370
|
}
|
|
553
371
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
var val = getInputValue(id);
|
|
372
|
+
const saveProps = (id, values) => {
|
|
373
|
+
let val = getInputValue(id);
|
|
557
374
|
val.width = values.width;
|
|
558
375
|
val.height = values.height;
|
|
559
376
|
val.signatory = values.signatory;
|
|
560
377
|
val.type = values.type === 'TEXT INPUT' ? 'TEXT_INPUT' : values.type;
|
|
561
|
-
|
|
378
|
+
let element = document.getElementById(id);
|
|
562
379
|
element.style.width = values.width + 'px';
|
|
563
380
|
element.style.height = values.height + 'px';
|
|
564
381
|
element.style.borderColor = VALID_COLOR;
|
|
@@ -566,7 +383,6 @@ var SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_
|
|
|
566
383
|
element.setAttribute('sid', values.signatory.emailAddress);
|
|
567
384
|
saveValue();
|
|
568
385
|
};
|
|
569
|
-
|
|
570
386
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
571
387
|
ref: ref,
|
|
572
388
|
style: {
|
|
@@ -612,7 +428,7 @@ var SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_
|
|
|
612
428
|
}, !_Utils.default.isNull(templateDoc) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
613
429
|
className: 'row'
|
|
614
430
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
615
|
-
className:
|
|
431
|
+
className: `${classes.palette} col-*-*`,
|
|
616
432
|
style: {
|
|
617
433
|
maxHeight: 'calc(70vh - 80px)',
|
|
618
434
|
overflow: 'auto',
|
|
@@ -622,14 +438,12 @@ var SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_
|
|
|
622
438
|
variant: "contained",
|
|
623
439
|
component: "span",
|
|
624
440
|
className: paletteSelectionId === 'INITIAL_ITEM' ? classes.paletteButtonSelected : classes.paletteButton,
|
|
625
|
-
onClick:
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
});
|
|
632
|
-
},
|
|
441
|
+
onClick: () => grabPalleteItem({
|
|
442
|
+
id: idCounter.current++,
|
|
443
|
+
description: 'Initial',
|
|
444
|
+
type: 'INITIAL_ITEM',
|
|
445
|
+
props: INITIAL_ITEM
|
|
446
|
+
}),
|
|
633
447
|
id: 'initialPaletteButton',
|
|
634
448
|
classes: {
|
|
635
449
|
'label': 'paletteButtonLabel'
|
|
@@ -638,14 +452,12 @@ var SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_
|
|
|
638
452
|
variant: "contained",
|
|
639
453
|
component: "span",
|
|
640
454
|
className: paletteSelectionId === 'SIGN_ITEM' ? classes.paletteButtonSelected : classes.paletteButton,
|
|
641
|
-
onClick:
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
});
|
|
648
|
-
},
|
|
455
|
+
onClick: () => grabPalleteItem({
|
|
456
|
+
id: idCounter.current++,
|
|
457
|
+
description: 'Signature',
|
|
458
|
+
type: 'SIGN_ITEM',
|
|
459
|
+
props: SIGN_ITEM
|
|
460
|
+
}),
|
|
649
461
|
id: 'initialPaletteButton',
|
|
650
462
|
classes: {
|
|
651
463
|
'label': 'paletteButtonLabel'
|
|
@@ -654,14 +466,12 @@ var SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_
|
|
|
654
466
|
variant: "contained",
|
|
655
467
|
component: "span",
|
|
656
468
|
className: paletteSelectionId === 'TEXT_ITEM' ? classes.paletteButtonSelected : classes.paletteButton,
|
|
657
|
-
onClick:
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
});
|
|
664
|
-
},
|
|
469
|
+
onClick: () => grabPalleteItem({
|
|
470
|
+
id: idCounter.current++,
|
|
471
|
+
description: 'Text',
|
|
472
|
+
type: 'TEXT_ITEM',
|
|
473
|
+
props: TEXT_ITEM
|
|
474
|
+
}),
|
|
665
475
|
id: 'initialPaletteButton',
|
|
666
476
|
classes: {
|
|
667
477
|
'label': 'paletteButtonLabel'
|
|
@@ -670,7 +480,7 @@ var SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_
|
|
|
670
480
|
variant: "contained",
|
|
671
481
|
component: "span",
|
|
672
482
|
className: classes.paletteButton,
|
|
673
|
-
onClick:
|
|
483
|
+
onClick: () => {
|
|
674
484
|
clear();
|
|
675
485
|
},
|
|
676
486
|
id: 'clearButton',
|
|
@@ -678,20 +488,14 @@ var SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_
|
|
|
678
488
|
'label': 'paletteButtonLabel'
|
|
679
489
|
}
|
|
680
490
|
}, "Clear"), /*#__PURE__*/_react.default.createElement("div", {
|
|
681
|
-
className:
|
|
491
|
+
className: `${classes.propertyWindow}`
|
|
682
492
|
}, /*#__PURE__*/_react.default.createElement(_SignatureInputProps.default, {
|
|
683
493
|
value: selectedInputBoxValue,
|
|
684
494
|
signatoryUrl: props.config.signatoryUrl,
|
|
685
495
|
signatoryService: props.config.signatoryService,
|
|
686
|
-
saveHandler:
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
deleteHandler: function deleteHandler(id, values) {
|
|
690
|
-
return deleteInputItem(id, values);
|
|
691
|
-
},
|
|
692
|
-
dublicateHandler: function dublicateHandler(id) {
|
|
693
|
-
return handleDuplicate(id);
|
|
694
|
-
}
|
|
496
|
+
saveHandler: (id, values) => saveProps(id, values),
|
|
497
|
+
deleteHandler: (id, values) => deleteInputItem(id, values),
|
|
498
|
+
dublicateHandler: id => handleDuplicate(id)
|
|
695
499
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
696
500
|
style: {
|
|
697
501
|
border: '1px solid #e1e1e1',
|
|
@@ -701,9 +505,7 @@ var SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_
|
|
|
701
505
|
width: 'calc(100% - 288px)'
|
|
702
506
|
},
|
|
703
507
|
className: 'col-*-*',
|
|
704
|
-
onClick:
|
|
705
|
-
return mouseClickHandler(e);
|
|
706
|
-
}
|
|
508
|
+
onClick: e => mouseClickHandler(e)
|
|
707
509
|
}, templateDoc ? /*#__PURE__*/_react.default.createElement("div", {
|
|
708
510
|
style: {
|
|
709
511
|
maxHeight: 'calc(70vh - 80px)',
|
|
@@ -722,6 +524,4 @@ var SignatureTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_
|
|
|
722
524
|
}
|
|
723
525
|
}, "no template to display"))) : null)) : /*#__PURE__*/_react.default.createElement("div", null, "Loading..."));
|
|
724
526
|
}));
|
|
725
|
-
|
|
726
|
-
var _default = SignatureTemplateDesigner;
|
|
727
|
-
exports.default = _default;
|
|
527
|
+
var _default = exports.default = SignatureTemplateDesigner;
|