@agilemotion/oui-react-js 1.6.3 → 1.6.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/ApplicationManager.js +675 -1044
- package/dist/BasicApp.js +7 -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 +26 -21
|
@@ -1,160 +1,70 @@
|
|
|
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 _ej2ReactRichtexteditor = require("@syncfusion/ej2-react-richtexteditor");
|
|
11
|
-
|
|
12
|
-
var React =
|
|
13
|
-
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var React = _react;
|
|
14
10
|
var _DocumentTemplatePlaceholderDialog = _interopRequireDefault(require("./DocumentTemplatePlaceholderDialog"));
|
|
15
|
-
|
|
16
11
|
var _mammoth = _interopRequireDefault(require("mammoth"));
|
|
17
|
-
|
|
18
12
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
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."); }
|
|
35
|
-
|
|
36
|
-
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); }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
40
|
-
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; }
|
|
41
|
-
|
|
42
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
|
-
|
|
44
|
-
var DocumentTemplateDesignerComponent = function DocumentTemplateDesignerComponent(props) {
|
|
45
|
-
var contractTemplate = props.contractTemplate,
|
|
46
|
-
uploadTrigger = props.uploadTrigger;
|
|
47
|
-
|
|
48
|
-
var _React$useState = React.useState(false),
|
|
49
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
50
|
-
open = _React$useState2[0],
|
|
51
|
-
setOpen = _React$useState2[1];
|
|
52
|
-
|
|
53
|
-
var _React$useState3 = React.useState(null),
|
|
54
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
55
|
-
error = _React$useState4[0],
|
|
56
|
-
setError = _React$useState4[1];
|
|
57
|
-
|
|
58
|
-
var _React$useState5 = React.useState(false),
|
|
59
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
60
|
-
documentLoaded = _React$useState6[0],
|
|
61
|
-
setDocumentLoaded = _React$useState6[1];
|
|
62
|
-
|
|
63
|
-
var fileInputRef = (0, React.useRef)(null);
|
|
64
|
-
var btnRef = (0, React.useRef)(null);
|
|
65
|
-
var rteObj;
|
|
66
|
-
var items = ['Bold', 'Italic', 'Underline', '|', 'Formats', '|', 'CreateLink', '|', {
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
const DocumentTemplateDesignerComponent = props => {
|
|
17
|
+
const {
|
|
18
|
+
contractTemplate,
|
|
19
|
+
uploadTrigger
|
|
20
|
+
} = props;
|
|
21
|
+
const [open, setOpen] = React.useState(false);
|
|
22
|
+
const [error, setError] = React.useState(null);
|
|
23
|
+
const [documentLoaded, setDocumentLoaded] = React.useState(false);
|
|
24
|
+
const fileInputRef = (0, _react.useRef)(null);
|
|
25
|
+
const btnRef = (0, _react.useRef)(null);
|
|
26
|
+
let rteObj;
|
|
27
|
+
let items = ['Bold', 'Italic', 'Underline', '|', 'Formats', '|', 'CreateLink', '|', {
|
|
67
28
|
template: '' + '<button class="e-tbar-btn e-btn" tabindex="-1" id="custom_tbar" style="width:100%"><div class="e-tbar-btn-text" style="font-weight: normal; font-size: inherit;"> Placeholders</div></button>',
|
|
68
29
|
undo: true,
|
|
69
|
-
click: onClick.bind(
|
|
30
|
+
click: onClick.bind(void 0),
|
|
70
31
|
tooltipText: 'Insert Placeholders'
|
|
71
32
|
}, '|', 'Undo', 'Redo'];
|
|
72
|
-
|
|
33
|
+
let toolbarSettings = {
|
|
73
34
|
items: items
|
|
74
35
|
};
|
|
75
|
-
|
|
76
36
|
function onInsert(holder) {
|
|
77
37
|
rteObj.executeCommand('insertText', holder);
|
|
78
38
|
}
|
|
79
|
-
|
|
80
39
|
function onClick() {
|
|
81
40
|
setOpen(true);
|
|
82
41
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var arrayBuffer, _yield$mammoth$conver, value;
|
|
101
|
-
|
|
102
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
103
|
-
while (1) {
|
|
104
|
-
switch (_context.prev = _context.next) {
|
|
105
|
-
case 0:
|
|
106
|
-
arrayBuffer = e.target.result;
|
|
107
|
-
_context.prev = 1;
|
|
108
|
-
_context.next = 4;
|
|
109
|
-
return _mammoth.default.convertToHtml({
|
|
110
|
-
arrayBuffer: arrayBuffer
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
case 4:
|
|
114
|
-
_yield$mammoth$conver = _context.sent;
|
|
115
|
-
value = _yield$mammoth$conver.value;
|
|
116
|
-
rteObj.executeCommand('insertHTML', value);
|
|
117
|
-
_context.next = 12;
|
|
118
|
-
break;
|
|
119
|
-
|
|
120
|
-
case 9:
|
|
121
|
-
_context.prev = 9;
|
|
122
|
-
_context.t0 = _context["catch"](1);
|
|
123
|
-
setError('Error processing the file. Please ensure it is a valid .docx file.');
|
|
124
|
-
|
|
125
|
-
case 12:
|
|
126
|
-
case "end":
|
|
127
|
-
return _context.stop();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}, _callee, null, [[1, 9]]);
|
|
131
|
-
}));
|
|
132
|
-
|
|
133
|
-
return function (_x2) {
|
|
134
|
-
return _ref2.apply(this, arguments);
|
|
135
|
-
};
|
|
136
|
-
}();
|
|
137
|
-
|
|
138
|
-
reader.readAsArrayBuffer(file);
|
|
139
|
-
} else {
|
|
140
|
-
setError('Unsupported file type. Please upload a .docx file.');
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
case 3:
|
|
145
|
-
case "end":
|
|
146
|
-
return _context2.stop();
|
|
42
|
+
const handleFileChange = async event => {
|
|
43
|
+
const file = event.target.files[0];
|
|
44
|
+
setError(null);
|
|
45
|
+
if (file) {
|
|
46
|
+
if (file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
|
|
47
|
+
const reader = new FileReader();
|
|
48
|
+
reader.onload = async e => {
|
|
49
|
+
const arrayBuffer = e.target.result;
|
|
50
|
+
try {
|
|
51
|
+
const {
|
|
52
|
+
value
|
|
53
|
+
} = await _mammoth.default.convertToHtml({
|
|
54
|
+
arrayBuffer
|
|
55
|
+
});
|
|
56
|
+
rteObj.executeCommand('insertHTML', value);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
setError('Error processing the file. Please ensure it is a valid .docx file.');
|
|
147
59
|
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
(0, React.useEffect)(function () {
|
|
60
|
+
};
|
|
61
|
+
reader.readAsArrayBuffer(file);
|
|
62
|
+
} else {
|
|
63
|
+
setError('Unsupported file type. Please upload a .docx file.');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
(0, _react.useEffect)(() => {
|
|
158
68
|
if (uploadTrigger != null && btnRef.current) {
|
|
159
69
|
btnRef.current.click();
|
|
160
70
|
}
|
|
@@ -175,7 +85,7 @@ var DocumentTemplateDesignerComponent = function DocumentTemplateDesignerCompone
|
|
|
175
85
|
accept: ".docx"
|
|
176
86
|
})), /*#__PURE__*/React.createElement(_ej2ReactRichtexteditor.RichTextEditorComponent, {
|
|
177
87
|
id: "defaultRTE",
|
|
178
|
-
ref:
|
|
88
|
+
ref: scope => {
|
|
179
89
|
rteObj = scope;
|
|
180
90
|
},
|
|
181
91
|
toolbarSettings: toolbarSettings
|
|
@@ -183,12 +93,8 @@ var DocumentTemplateDesignerComponent = function DocumentTemplateDesignerCompone
|
|
|
183
93
|
services: [_ej2ReactRichtexteditor.HtmlEditor, _ej2ReactRichtexteditor.Toolbar, _ej2ReactRichtexteditor.Link, _ej2ReactRichtexteditor.Image, _ej2ReactRichtexteditor.QuickToolbar]
|
|
184
94
|
})), /*#__PURE__*/React.createElement(_DocumentTemplatePlaceholderDialog.default, {
|
|
185
95
|
open: open,
|
|
186
|
-
onClose:
|
|
187
|
-
return setOpen(false);
|
|
188
|
-
},
|
|
96
|
+
onClose: () => setOpen(false),
|
|
189
97
|
onInsertHandler: onInsert
|
|
190
98
|
}));
|
|
191
99
|
};
|
|
192
|
-
|
|
193
|
-
var _default = DocumentTemplateDesignerComponent;
|
|
194
|
-
exports.default = _default;
|
|
100
|
+
var _default = exports.default = DocumentTemplateDesignerComponent;
|
|
@@ -1,47 +1,23 @@
|
|
|
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 = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
8
|
var _core = require("@material-ui/core");
|
|
13
|
-
|
|
14
9
|
var _icons = require("@material-ui/icons");
|
|
15
|
-
|
|
16
10
|
require("./DocumentTemplateDesignerComponent.css");
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
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; }
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
32
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
-
|
|
34
|
-
var DocumentTemplatePlaceholderDialog = function DocumentTemplatePlaceholderDialog(_ref) {
|
|
35
|
-
var open = _ref.open,
|
|
36
|
-
onClose = _ref.onClose,
|
|
37
|
-
onInsertHandler = _ref.onInsertHandler;
|
|
38
|
-
|
|
39
|
-
var _useState = (0, _react.useState)(null),
|
|
40
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
-
selectedIndex = _useState2[0],
|
|
42
|
-
setSelectedIndex = _useState2[1];
|
|
43
|
-
|
|
44
|
-
var placeholders = [{
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
const DocumentTemplatePlaceholderDialog = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
open,
|
|
16
|
+
onClose,
|
|
17
|
+
onInsertHandler
|
|
18
|
+
} = _ref;
|
|
19
|
+
const [selectedIndex, setSelectedIndex] = (0, _react.useState)(null);
|
|
20
|
+
const placeholders = [{
|
|
45
21
|
title: 'Placeholder 1',
|
|
46
22
|
description: '{{placeholder_1}}'
|
|
47
23
|
}, {
|
|
@@ -54,23 +30,19 @@ var DocumentTemplatePlaceholderDialog = function DocumentTemplatePlaceholderDial
|
|
|
54
30
|
title: 'Placeholder 4',
|
|
55
31
|
description: '{{placeholder_4}}'
|
|
56
32
|
}];
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var handleListItemClick = function handleListItemClick(index) {
|
|
33
|
+
const {
|
|
34
|
+
palette
|
|
35
|
+
} = (0, _core.useTheme)();
|
|
36
|
+
const handleListItemClick = index => {
|
|
62
37
|
setSelectedIndex(index);
|
|
63
38
|
};
|
|
64
|
-
|
|
65
|
-
var handleInsert = function handleInsert() {
|
|
39
|
+
const handleInsert = () => {
|
|
66
40
|
if (selectedIndex !== null) {
|
|
67
|
-
console.log(
|
|
41
|
+
console.log(`Selected placeholder: ${placeholders[selectedIndex].title}`);
|
|
68
42
|
onInsertHandler(placeholders[selectedIndex].description);
|
|
69
43
|
}
|
|
70
|
-
|
|
71
44
|
onClose();
|
|
72
45
|
};
|
|
73
|
-
|
|
74
46
|
return /*#__PURE__*/_react.default.createElement(_core.Dialog, {
|
|
75
47
|
open: open,
|
|
76
48
|
onClose: onClose,
|
|
@@ -78,26 +50,23 @@ var DocumentTemplatePlaceholderDialog = function DocumentTemplatePlaceholderDial
|
|
|
78
50
|
maxWidth: 'md'
|
|
79
51
|
}, /*#__PURE__*/_react.default.createElement(_core.DialogTitle, null, "Select a Placeholder"), /*#__PURE__*/_react.default.createElement(_core.DialogContent, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
80
52
|
id: "customTbarDialog"
|
|
81
|
-
}, /*#__PURE__*/_react.default.createElement(_core.List, null, placeholders.map(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
secondary: placeholder.description
|
|
99
|
-
})), index < placeholders.length - 1 && /*#__PURE__*/_react.default.createElement(_core.Divider, null));
|
|
100
|
-
})))), /*#__PURE__*/_react.default.createElement(_core.DialogActions, null, /*#__PURE__*/_react.default.createElement(_core.Button, {
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_core.List, null, placeholders.map((placeholder, index) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
54
|
+
key: index
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_core.ListItem, {
|
|
56
|
+
button: true,
|
|
57
|
+
selected: selectedIndex === index,
|
|
58
|
+
onClick: () => handleListItemClick(index)
|
|
59
|
+
// className="char_block"
|
|
60
|
+
,
|
|
61
|
+
style: {
|
|
62
|
+
border: selectedIndex === index ? `1px solid ${palette.primary.main}` : null,
|
|
63
|
+
margin: '4px 0',
|
|
64
|
+
borderRadius: '4px'
|
|
65
|
+
}
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(_core.ListItemAvatar, null, /*#__PURE__*/_react.default.createElement(_core.Avatar, null, /*#__PURE__*/_react.default.createElement(_icons.AddCircle, null))), /*#__PURE__*/_react.default.createElement(_core.ListItemText, {
|
|
67
|
+
primary: placeholder.title,
|
|
68
|
+
secondary: placeholder.description
|
|
69
|
+
})), index < placeholders.length - 1 && /*#__PURE__*/_react.default.createElement(_core.Divider, null)))))), /*#__PURE__*/_react.default.createElement(_core.DialogActions, null, /*#__PURE__*/_react.default.createElement(_core.Button, {
|
|
101
70
|
onClick: onClose,
|
|
102
71
|
color: "primary"
|
|
103
72
|
}, "Cancel"), /*#__PURE__*/_react.default.createElement(_core.Button, {
|
|
@@ -106,6 +75,4 @@ var DocumentTemplatePlaceholderDialog = function DocumentTemplatePlaceholderDial
|
|
|
106
75
|
disabled: selectedIndex === null
|
|
107
76
|
}, "Insert")));
|
|
108
77
|
};
|
|
109
|
-
|
|
110
|
-
var _default = DocumentTemplatePlaceholderDialog;
|
|
111
|
-
exports.default = _default;
|
|
78
|
+
var _default = exports.default = DocumentTemplatePlaceholderDialog;
|
|
@@ -4,104 +4,67 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _Utils = _interopRequireDefault(require("../Utils"));
|
|
11
|
-
|
|
12
9
|
var _Observable = _interopRequireDefault(require("../event/Observable"));
|
|
13
|
-
|
|
14
10
|
var _ApplicationManager = _interopRequireDefault(require("../ApplicationManager"));
|
|
15
|
-
|
|
16
11
|
var _RestUtils = require("../RestUtils");
|
|
17
|
-
|
|
18
12
|
var _ServiceCallActionHandler = _interopRequireDefault(require("../event/ServiceCallActionHandler"));
|
|
19
|
-
|
|
20
13
|
var _DynamicJS = _interopRequireDefault(require("../DynamicJS"));
|
|
21
|
-
|
|
22
14
|
require("./DocumentView.css");
|
|
23
|
-
|
|
24
15
|
var _DocumentViewerComponent = _interopRequireDefault(require("./DocumentViewerComponent"));
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
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."); }
|
|
31
|
-
|
|
32
|
-
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); }
|
|
33
|
-
|
|
34
|
-
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; }
|
|
35
|
-
|
|
36
|
-
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; }
|
|
37
|
-
|
|
38
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
|
-
|
|
40
|
-
var DocumentViewer = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
41
|
-
var _React$useState = _react.default.useState(null),
|
|
42
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
43
|
-
value = _React$useState2[0],
|
|
44
|
-
setValue = _React$useState2[1];
|
|
45
|
-
|
|
46
|
-
_react.default.useEffect(function () {
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
const DocumentViewer = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
18
|
+
const [value, setValue] = _react.default.useState(null);
|
|
19
|
+
_react.default.useEffect(() => {
|
|
47
20
|
props.handle.api = api();
|
|
48
21
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
52
|
-
|
|
22
|
+
_react.default.useEffect(() => {
|
|
23
|
+
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
53
24
|
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
|
|
54
|
-
|
|
55
25
|
_Observable.default.addSystemSubscriptions(props.viewId, parsedConfig);
|
|
56
26
|
}, []);
|
|
57
|
-
|
|
58
|
-
var api = function api() {
|
|
27
|
+
const api = () => {
|
|
59
28
|
return {
|
|
60
29
|
get id() {
|
|
61
30
|
return props.config.id;
|
|
62
31
|
},
|
|
63
|
-
|
|
64
|
-
loadData: function loadData(actionConfig) {
|
|
32
|
+
loadData: actionConfig => {
|
|
65
33
|
if (!_Utils.default.isNull(actionConfig) && !_Utils.default.isNull(actionConfig.value)) {
|
|
66
|
-
|
|
67
|
-
|
|
34
|
+
let value = _ApplicationManager.default.isExpression(actionConfig.value) ? _ApplicationManager.default.resolveExpressionValue(actionConfig.value) : actionConfig.value;
|
|
35
|
+
// TODO : set value
|
|
68
36
|
} else {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
37
|
+
let service = !_Utils.default.isNull(props.config.dataService) ? props.config.dataService : actionConfig !== null ? actionConfig.dataService : null;
|
|
38
|
+
let componentValue = !_Utils.default.isNull(props.config.value) ? props.config.value : actionConfig !== null ? actionConfig.value : null;
|
|
72
39
|
if (!_Utils.default.isNull(service)) {
|
|
73
40
|
if (service.type === 'rpc') {
|
|
74
|
-
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId,
|
|
41
|
+
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId, result => {}, e => {}, parameter => {});
|
|
75
42
|
} else {
|
|
76
43
|
if (_Utils.default.isNull(actionConfig)) {
|
|
77
44
|
actionConfig = {};
|
|
78
45
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var file = {};
|
|
84
|
-
|
|
46
|
+
actionConfig.service = service;
|
|
47
|
+
// TODO : Implement the invalid paramenter callback
|
|
48
|
+
_ServiceCallActionHandler.default.execute(actionConfig, null, null, props.viewId, data => {
|
|
49
|
+
let file = {};
|
|
85
50
|
if (data.payloadBase64) {
|
|
86
51
|
file.base64 = data.payloadBase64;
|
|
87
52
|
} else if (data.url) {
|
|
88
53
|
file.base64 = data.url.replace('data:application/pdf;base64,', '');
|
|
89
54
|
}
|
|
90
|
-
|
|
91
55
|
file.type = props.config.fileType;
|
|
92
56
|
setValue(file);
|
|
93
|
-
},
|
|
57
|
+
}, () => {});
|
|
94
58
|
}
|
|
95
59
|
} else {
|
|
96
60
|
if (!_Utils.default.isNull(componentValue)) {
|
|
97
61
|
if (_ApplicationManager.default.isExpression(componentValue)) {
|
|
98
|
-
|
|
99
|
-
|
|
62
|
+
let path = _Utils.default.getPropertyChainPath(componentValue);
|
|
100
63
|
if (!_Utils.default.isNull(path.valueObject)) {
|
|
101
|
-
_Observable.default.addSystemGeneratedSubscription(props.viewId, props.viewId, props.config.id,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
64
|
+
_Observable.default.addSystemGeneratedSubscription(props.viewId, props.viewId, props.config.id, () => {
|
|
65
|
+
let value = _DynamicJS.default.executeScript(`${props.config.id}ValueEvaluator`, componentValue);
|
|
66
|
+
if (!_Utils.default.isNull(value)) {
|
|
67
|
+
// TODO : set value
|
|
105
68
|
}
|
|
106
69
|
});
|
|
107
70
|
}
|
|
@@ -112,14 +75,11 @@ var DocumentViewer = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.defau
|
|
|
112
75
|
}
|
|
113
76
|
};
|
|
114
77
|
};
|
|
115
|
-
|
|
116
78
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
117
79
|
ref: ref
|
|
118
80
|
}, !_Utils.default.isNull(value) ? /*#__PURE__*/_react.default.createElement(_DocumentViewerComponent.default, {
|
|
119
81
|
file: value,
|
|
120
|
-
onDocumentLoadSuccess:
|
|
82
|
+
onDocumentLoadSuccess: () => {}
|
|
121
83
|
}) : null);
|
|
122
84
|
}));
|
|
123
|
-
|
|
124
|
-
var _default = DocumentViewer;
|
|
125
|
-
exports.default = _default;
|
|
85
|
+
var _default = exports.default = DocumentViewer;
|
|
@@ -4,61 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactPdf = require("react-pdf");
|
|
11
|
-
|
|
12
9
|
var _Utils = _interopRequireDefault(require("../Utils"));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
-
|
|
28
|
-
_reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(_reactPdf.pdfjs.version, "/pdf.worker.js");
|
|
29
|
-
|
|
30
|
-
var DocumentViewerComponent = function DocumentViewerComponent(props) {
|
|
31
|
-
var _React$useState = _react.default.useState(1),
|
|
32
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
33
|
-
pageNumber = _React$useState2[0],
|
|
34
|
-
setPageNumber = _React$useState2[1];
|
|
35
|
-
|
|
36
|
-
var _React$useState3 = _react.default.useState(null),
|
|
37
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
38
|
-
numPages = _React$useState4[0],
|
|
39
|
-
setNumPages = _React$useState4[1];
|
|
40
|
-
|
|
41
|
-
var onDocumentLoadSuccess = function onDocumentLoadSuccess(_ref) {
|
|
42
|
-
var numPages = _ref.numPages;
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
_reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${_reactPdf.pdfjs.version}/pdf.worker.js`;
|
|
12
|
+
const DocumentViewerComponent = props => {
|
|
13
|
+
const [pageNumber, setPageNumber] = _react.default.useState(1);
|
|
14
|
+
const [numPages, setNumPages] = _react.default.useState(null);
|
|
15
|
+
const onDocumentLoadSuccess = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
numPages
|
|
18
|
+
} = _ref;
|
|
43
19
|
setNumPages(numPages);
|
|
44
|
-
|
|
45
20
|
if (!_Utils.default.isNull(props.onDocumentLoadSuccess)) {
|
|
46
21
|
props.onDocumentLoadSuccess(numPages);
|
|
47
22
|
}
|
|
48
23
|
};
|
|
49
|
-
|
|
50
|
-
var changePage = function changePage(offset) {
|
|
24
|
+
const changePage = offset => {
|
|
51
25
|
setPageNumber(pageNumber + offset);
|
|
52
26
|
};
|
|
53
|
-
|
|
54
|
-
var previousPage = function previousPage() {
|
|
27
|
+
const previousPage = () => {
|
|
55
28
|
changePage(-1);
|
|
56
29
|
};
|
|
57
|
-
|
|
58
|
-
var nextPage = function nextPage() {
|
|
30
|
+
const nextPage = () => {
|
|
59
31
|
changePage(1);
|
|
60
32
|
};
|
|
61
|
-
|
|
62
33
|
return /*#__PURE__*/_react.default.createElement("div", null, !_Utils.default.isNull(props.file) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
63
34
|
style: {
|
|
64
35
|
borderRadius: "4px",
|
|
@@ -87,6 +58,4 @@ var DocumentViewerComponent = function DocumentViewerComponent(props) {
|
|
|
87
58
|
alt: ''
|
|
88
59
|
}), props.onDocumentLoadSuccess(1))) : null);
|
|
89
60
|
};
|
|
90
|
-
|
|
91
|
-
var _default = DocumentViewerComponent;
|
|
92
|
-
exports.default = _default;
|
|
61
|
+
var _default = exports.default = DocumentViewerComponent;
|