@agilemotion/oui-react-js 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApplicationManager.js +698 -421
- package/dist/BasicApp.js +5 -5
- package/dist/BasicAppHome.js +55 -26
- package/dist/DynamicJS.js +147 -65
- package/dist/InteractionPortalApp.css +1 -1
- package/dist/InteractionPortalApp.js +5 -5
- package/dist/InteractionPortalAppHome.js +57 -22
- package/dist/InteractionPortalApp_old.js +107 -61
- package/dist/RestUtils.js +339 -287
- package/dist/TypedValue.js +18 -15
- package/dist/Utils.js +375 -276
- package/dist/WithRouter.js +6 -6
- package/dist/assets/jss/components/authNavbarStyle.js +166 -164
- package/dist/assets/jss/components/buttonStyle.js +1 -1
- package/dist/assets/jss/components/cardAvatarStyle.js +1 -1
- package/dist/assets/jss/components/cardBodyStyle.js +1 -1
- package/dist/assets/jss/components/cardFooterStyle.js +1 -1
- package/dist/assets/jss/components/cardHeaderStyle.js +13 -13
- package/dist/assets/jss/components/cardIconStyle.js +1 -1
- package/dist/assets/jss/components/cardStyle.js +1 -1
- package/dist/assets/jss/components/cardTextStyle.js +1 -1
- package/dist/assets/jss/components/customDropdownStyle.js +168 -169
- package/dist/assets/jss/components/customInputStyle.js +9 -3
- package/dist/assets/jss/components/dropdownStyle.js +69 -69
- package/dist/assets/jss/components/footerStyle.js +19 -13
- package/dist/assets/jss/components/headerLinksStyle.js +45 -48
- package/dist/assets/jss/components/headerStyle.js +68 -65
- package/dist/assets/jss/components/navbarLinksStyle.js +66 -77
- package/dist/assets/jss/components/navbarStyle.js +79 -76
- package/dist/assets/jss/components/sidebarStyle.js +436 -436
- package/dist/assets/jss/components/typographyStyle.js +9 -3
- package/dist/assets/jss/rootStyle.js +96 -81
- package/dist/assets/jss/views/layoutStyle.js +44 -41
- package/dist/assets/jss/views/loginBasicStyle.js +1 -1
- package/dist/assets/jss/views/loginBusinessPortalStyle.js +1 -1
- package/dist/assets/jss/views/loginStyle.js +82 -77
- package/dist/components/AlertBar.js +50 -17
- package/dist/components/AlertItem.js +35 -12
- package/dist/components/AlertTemplate.js +30 -29
- package/dist/components/Button.js +62 -34
- package/dist/components/Calendar.js +140 -91
- package/dist/components/ConfirmationDialog.js +36 -11
- package/dist/components/DataGrid.js +512 -270
- package/dist/components/DataGridColumn.js +47 -22
- package/dist/components/DataGridFilter.js +186 -105
- package/dist/components/DataGridHeading.js +50 -32
- package/dist/components/Dialog.js +90 -35
- package/dist/components/DocumentTemplateDesigner.js +34 -16
- package/dist/components/DocumentTemplateDesignerComponent.js +124 -48
- package/dist/components/DocumentTemplatePlaceholderDialog.js +52 -30
- package/dist/components/DocumentViewer.js +34 -18
- package/dist/components/DocumentViewerComponent.js +26 -9
- package/dist/components/ElementResizeHandler.js +229 -207
- package/dist/components/FileThumb.js +32 -10
- package/dist/components/Graph.js +153 -85
- package/dist/components/GraphNode.js +58 -38
- package/dist/components/HtmlPanel.js +67 -39
- package/dist/components/Icon.js +206 -166
- package/dist/components/LoadingIndicator.js +3 -3
- package/dist/components/LottieIcon.js +1 -1
- package/dist/components/PopupView.js +39 -19
- package/dist/components/Portlet.js +32 -17
- package/dist/components/RegularButton.js +28 -32
- package/dist/components/SignaturePanel.js +37 -17
- package/dist/components/SocketManager.js +178 -119
- package/dist/components/StepperTitleBar.js +62 -42
- package/dist/components/TabPage.js +30 -25
- package/dist/components/TabPanel.js +86 -33
- package/dist/components/TableCellContent.js +51 -32
- package/dist/components/TemplateDesigner.js +173 -121
- package/dist/components/TemplateItemEventHandler.js +335 -221
- package/dist/components/TemplateTable.js +183 -118
- package/dist/components/TitleBar.js +26 -11
- package/dist/components/Toolbar.js +67 -38
- package/dist/components/Tooltip.js +43 -35
- package/dist/components/Tree.js +85 -44
- package/dist/components/UseIsVisible.js +25 -4
- package/dist/components/card/Card.js +27 -33
- package/dist/components/card/CardAvatar.js +20 -19
- package/dist/components/card/CardBody.js +24 -27
- package/dist/components/card/CardFooter.js +23 -24
- package/dist/components/card/CardHeader.js +24 -27
- package/dist/components/card/CardIcon.js +17 -13
- package/dist/components/card/CardText.js +17 -13
- package/dist/components/customInput/CustomInput.js +22 -36
- package/dist/components/dashboard/{BasicBusinessAppDashboard.js → FoldingSideTabDashboard.js} +111 -63
- package/dist/components/dashboard/SideMenuModuleDashboard.css +60 -0
- package/dist/components/dashboard/SideMenuModuleDashboard.js +423 -0
- package/dist/components/dashboard/TopMenuModuleDashboard.js +138 -0
- package/dist/components/dashboard/components/Header.js +29 -12
- package/dist/components/dashboard/components/LeftDrawer.js +3 -5
- package/dist/components/dashboard/components/UserIdentity.js +2 -2
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +131 -87
- package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +488 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +64 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.css +65 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +556 -0
- package/dist/components/dashboard/components/portal/Timeline.js +1 -1
- package/dist/components/dashboard/components/portal/Workspace.js +5 -11
- package/dist/components/footer/Footer.js +31 -24
- package/dist/components/footer/HomeFooter.js +68 -34
- package/dist/components/form/AddressSearch.js +78 -42
- package/dist/components/form/AutoComplete.js +136 -55
- package/dist/components/form/BaseField.js +108 -56
- package/dist/components/form/Checkbox.js +10 -8
- package/dist/components/form/DatePicker.js +47 -25
- package/dist/components/form/FieldSet.js +217 -84
- package/dist/components/form/Form.js +334 -200
- package/dist/components/form/GridField.js +185 -82
- package/dist/components/form/IconField.js +9 -7
- package/dist/components/form/ImageEditor.js +141 -92
- package/dist/components/form/LabelField.js +12 -10
- package/dist/components/form/LookupField.js +54 -32
- package/dist/components/form/MultiFileUploadField.js +101 -67
- package/dist/components/form/RadioGroup.js +33 -16
- package/dist/components/form/Section.js +84 -34
- package/dist/components/form/SelectItem.js +55 -33
- package/dist/components/form/SignatureTemplateDesignerField.js +11 -9
- package/dist/components/form/Switch.js +10 -8
- package/dist/components/form/TextField.js +34 -16
- package/dist/components/form/TimePicker.js +19 -15
- package/dist/components/form/TransferList.js +153 -75
- package/dist/components/form/UploadField.js +183 -128
- package/dist/components/grid/GridContainer.js +12 -8
- package/dist/components/grid/GridItem.js +12 -8
- package/dist/components/layout/CollapsiblePanel.js +44 -18
- package/dist/components/layout/Layout.js +81 -40
- package/dist/components/layout/VC.css +1 -1
- package/dist/components/layout/View.js +136 -62
- package/dist/components/layout/ViewContainer.js +13 -11
- package/dist/components/layout/ViewPort.js +25 -10
- package/dist/components/layout/Window.js +87 -53
- package/dist/components/layout/WindowViewPort.js +38 -16
- package/dist/components/media/ClosablePanel.js +7 -7
- package/dist/components/media/LobbyWaitingList.js +7 -9
- package/dist/components/media/MediaSoupHelper.js +379 -187
- package/dist/components/media/SideBarContent.js +22 -14
- package/dist/components/media/SocketRequest.js +5 -1
- package/dist/components/media/SocketResponse.js +5 -1
- package/dist/components/media/Timer.js +35 -15
- package/dist/components/media/Toolbar.css +5 -0
- package/dist/components/media/Toolbar.js +220 -102
- package/dist/components/media/ToolbarButton.js +82 -33
- package/dist/components/media/Toolbar_bck.js +142 -70
- package/dist/components/media/Tracks.js +31 -28
- package/dist/components/media/TrainingRoom.js +284 -121
- package/dist/components/media/Transports.js +27 -24
- package/dist/components/media/VCEventManager.js +95 -31
- package/dist/components/media/VCEventType.js +5 -1
- package/dist/components/media/VCParticipantList.js +40 -14
- package/dist/components/media/VCParticipantListItem.js +92 -41
- package/dist/components/media/VCRoom.js +29 -11
- package/dist/components/media/VCRoomParticipant.js +488 -242
- package/dist/components/media/VCRoomRecorder.js +236 -175
- package/dist/components/media/VCRoomWorkspace.js +505 -245
- package/dist/components/media/Video.js +89 -25
- package/dist/components/media/VideoPlayer.js +56 -22
- package/dist/components/media/chat/ChatRoom.js +255 -132
- package/dist/components/media/chat/ChatRoomItem.js +35 -14
- package/dist/components/media/chat/ChatRoomList.js +43 -13
- package/dist/components/menu/CollapsibleMenu.js +39 -20
- package/dist/components/menu/MenuBars.js +81 -48
- package/dist/components/menu/MenuButton.js +95 -60
- package/dist/components/menu/MenuItem.js +28 -9
- package/dist/components/menu/MenuLink.js +12 -10
- package/dist/components/menu/PopupMenu.js +16 -12
- package/dist/components/navbars/AuthNavbar.js +27 -18
- package/dist/components/navbars/HomeNavbar.js +243 -194
- package/dist/components/navbars/PortalNavbar.js +50 -26
- package/dist/components/signatures/AgilitySignaturePanel.js +96 -39
- package/dist/components/signatures/AlertItem.js +36 -13
- package/dist/components/signatures/Card.js +4 -4
- package/dist/components/signatures/DocumentContainer.js +141 -57
- package/dist/components/signatures/ImageSignatureInput.js +90 -59
- package/dist/components/signatures/MenuButton.js +53 -33
- package/dist/components/signatures/Prompt.js +26 -5
- package/dist/components/signatures/ResponsiveTable.js +302 -197
- package/dist/components/signatures/SearchView.js +77 -36
- package/dist/components/signatures/SignatorySearch.js +30 -10
- package/dist/components/signatures/SignatorySearchForm.js +35 -18
- package/dist/components/signatures/SignatureInput.js +56 -26
- package/dist/components/signatures/SignatureInputProps.js +107 -55
- package/dist/components/signatures/SignatureTemplateDesigner.js +340 -235
- package/dist/components/signatures/Toolbar.js +135 -94
- package/dist/components/signatures/ViewUtils.js +273 -224
- package/dist/components/typography/Danger.js +3 -5
- package/dist/components/typography/Info.js +3 -5
- package/dist/components/typography/Link.js +3 -5
- package/dist/event/ActionHandlers.js +57 -43
- package/dist/event/Event.js +16 -13
- package/dist/event/EventListener.js +39 -36
- package/dist/event/EventType.js +5 -1
- package/dist/event/LoadDataActionHandler.js +20 -8
- package/dist/event/Observable.js +323 -142
- package/dist/event/RouteActionHandler.js +139 -125
- package/dist/event/ScriptActionHandler.js +20 -8
- package/dist/event/ServiceCallActionHandler.js +51 -39
- package/dist/event/SignalGraphActionHandler.js +19 -7
- package/dist/js/Addresses.js +38 -24
- package/dist/js/Calendar.js +168 -161
- package/dist/js/DynamicLib.js +14 -11
- package/dist/js/Media.js +213 -120
- package/dist/js/Validators.js +6 -5
- package/dist/js/Windows.js +48 -47
- package/dist/redux/store/ConfigureStore.js +17 -9
- package/dist/redux/store/DashboardStore.js +110 -43
- package/dist/redux/store/History.js +1 -1
- package/dist/redux/store/SecurityStore.js +59 -20
- package/dist/security/TokenManager.js +44 -30
- package/dist/theme-default.js +1 -1
- package/dist/view/Dashboard.js +230 -137
- package/dist/view/PortalDashboard.js +4 -4
- package/dist/view/Settings.js +4 -2
- package/dist/view/Views.js +27 -14
- package/dist/view/security/ChangePasswordBasic.js +97 -40
- package/dist/view/security/ForgotPassword.js +59 -22
- package/dist/view/security/ForgotPasswordBasic.js +62 -21
- package/dist/view/security/Login.js +64 -24
- package/dist/view/security/LoginBasic.js +65 -26
- package/dist/view/security/LoginInteractionPortal.js +62 -25
- package/dist/view/security/ResetPassword.js +65 -23
- package/dist/view/security/ResetPasswordBasic.js +91 -37
- package/dist/view/security/Security.js +12 -12
- package/package.json +1 -2
- package/dist/components/dashboard/BusinessPortalAppDashboard.js +0 -115
- package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +0 -447
- /package/dist/components/dashboard/{BusinessPortalAppDashboard.css → TopMenuModuleDashboard.css} +0 -0
- /package/dist/components/dashboard/components/blackDashboard/sidebar/{Sidebar.css → FoldingTabSidebar.css} +0 -0
|
@@ -21,27 +21,50 @@ var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
const [layoutHandle] = _react.default.useState({});
|
|
24
|
+
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; } } }; }
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
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."); }
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
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); }
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
var Dialog = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
39
|
+
var _React$useState = _react.default.useState({}),
|
|
40
|
+
_React$useState2 = _slicedToArray(_React$useState, 1),
|
|
41
|
+
layoutHandle = _React$useState2[0];
|
|
42
|
+
|
|
43
|
+
var _React$useState3 = _react.default.useState({}),
|
|
44
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
45
|
+
model = _React$useState4[0];
|
|
46
|
+
|
|
47
|
+
var _React$useState5 = _react.default.useState(false),
|
|
48
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
49
|
+
open = _React$useState6[0],
|
|
50
|
+
setOpen = _React$useState6[1];
|
|
51
|
+
|
|
52
|
+
var _React$useState7 = _react.default.useState(_Utils.default.getComponentAttribute(props.config, 'title', null)),
|
|
53
|
+
_React$useState8 = _slicedToArray(_React$useState7, 1),
|
|
54
|
+
title = _React$useState8[0];
|
|
55
|
+
|
|
56
|
+
_react.default.useEffect(function () {
|
|
34
57
|
props.handle.api = api();
|
|
35
58
|
});
|
|
36
59
|
|
|
37
|
-
_react.default.useEffect(()
|
|
60
|
+
_react.default.useEffect(function () {
|
|
38
61
|
props.handle.api = api();
|
|
39
62
|
|
|
40
63
|
if (_Utils.default.isNull(props.config.layout.id)) {
|
|
41
64
|
props.config.layout.id = props.config.id + '_layout';
|
|
42
65
|
}
|
|
43
66
|
|
|
44
|
-
|
|
67
|
+
var parsedConfig = _Utils.default.parseConfig(props.config, props.config.id);
|
|
45
68
|
|
|
46
69
|
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.config.id);
|
|
47
70
|
|
|
@@ -50,8 +73,8 @@ const Dialog = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.for
|
|
|
50
73
|
|
|
51
74
|
function doUpdateModel(values) {
|
|
52
75
|
if (!_Utils.default.isNull(values)) {
|
|
53
|
-
for (
|
|
54
|
-
|
|
76
|
+
for (var i = 0; i < values.length; i++) {
|
|
77
|
+
var value = values[i];
|
|
55
78
|
model[value.name] = value.value;
|
|
56
79
|
}
|
|
57
80
|
}
|
|
@@ -59,11 +82,11 @@ const Dialog = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.for
|
|
|
59
82
|
_Observable.default.processSystemGeneratedSubscriptions(props.config.id);
|
|
60
83
|
}
|
|
61
84
|
|
|
62
|
-
_react.default.useEffect(()
|
|
85
|
+
_react.default.useEffect(function () {
|
|
63
86
|
doUpdateModel(props.parameters);
|
|
64
87
|
}, [props.parameters]);
|
|
65
88
|
|
|
66
|
-
|
|
89
|
+
var createLayoutHandle = function createLayoutHandle(layout, api) {
|
|
67
90
|
layoutHandle.api = api;
|
|
68
91
|
return layoutHandle;
|
|
69
92
|
};
|
|
@@ -71,7 +94,7 @@ const Dialog = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.for
|
|
|
71
94
|
function render(layout) {
|
|
72
95
|
return /*#__PURE__*/_react.default.createElement(_Layout.Layout, {
|
|
73
96
|
ref: /*#__PURE__*/_react.default.createRef(),
|
|
74
|
-
handleFactory: (layout, api)
|
|
97
|
+
handleFactory: function handleFactory(layout, api) {
|
|
75
98
|
createLayoutHandle(layout, api);
|
|
76
99
|
},
|
|
77
100
|
config: layout,
|
|
@@ -80,68 +103,100 @@ const Dialog = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.for
|
|
|
80
103
|
});
|
|
81
104
|
}
|
|
82
105
|
|
|
83
|
-
|
|
106
|
+
var api = function api() {
|
|
84
107
|
return {
|
|
85
108
|
get id() {
|
|
86
109
|
return props.config.id;
|
|
87
110
|
},
|
|
88
111
|
|
|
89
112
|
get model() {
|
|
90
|
-
|
|
113
|
+
var children = layoutHandle.api.getChildren();
|
|
91
114
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
let valueGetter = !_Utils.default.isNull(child.api.model) ? child.api.model : !_Utils.default.isNull(child.api.getValue) ? child.api.getValue : child.api.value;
|
|
115
|
+
var _iterator = _createForOfIteratorHelper(children),
|
|
116
|
+
_step;
|
|
95
117
|
|
|
96
|
-
|
|
97
|
-
|
|
118
|
+
try {
|
|
119
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
120
|
+
var child = _step.value;
|
|
121
|
+
|
|
122
|
+
if (!_Utils.default.isNull(child.api)) {
|
|
123
|
+
var valueGetter = !_Utils.default.isNull(child.api.model) ? child.api.model : !_Utils.default.isNull(child.api.getValue) ? child.api.getValue : child.api.value;
|
|
124
|
+
|
|
125
|
+
if (!_Utils.default.isNull(valueGetter)) {
|
|
126
|
+
model[child.api.id] = typeof valueGetter === 'function' ? valueGetter() : valueGetter;
|
|
127
|
+
}
|
|
98
128
|
}
|
|
99
129
|
}
|
|
130
|
+
} catch (err) {
|
|
131
|
+
_iterator.e(err);
|
|
132
|
+
} finally {
|
|
133
|
+
_iterator.f();
|
|
100
134
|
}
|
|
101
135
|
|
|
102
136
|
return model;
|
|
103
137
|
},
|
|
104
138
|
|
|
105
|
-
open: ()
|
|
139
|
+
open: function open() {
|
|
106
140
|
setOpen(true);
|
|
107
141
|
},
|
|
108
|
-
close: ()
|
|
142
|
+
close: function close() {
|
|
109
143
|
setOpen(false);
|
|
110
144
|
},
|
|
111
|
-
getChild: id
|
|
145
|
+
getChild: function getChild(id) {
|
|
112
146
|
if (id === layoutHandle.api.id) {
|
|
113
147
|
return layoutHandle;
|
|
114
148
|
}
|
|
115
149
|
|
|
116
|
-
|
|
150
|
+
var children = layoutHandle.api.getChildren();
|
|
151
|
+
|
|
152
|
+
var _iterator2 = _createForOfIteratorHelper(children),
|
|
153
|
+
_step2;
|
|
154
|
+
|
|
155
|
+
try {
|
|
156
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
157
|
+
var child = _step2.value;
|
|
117
158
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
159
|
+
if (!_Utils.default.isNull(child.api) && id === child.api.id) {
|
|
160
|
+
return child;
|
|
161
|
+
}
|
|
121
162
|
}
|
|
163
|
+
} catch (err) {
|
|
164
|
+
_iterator2.e(err);
|
|
165
|
+
} finally {
|
|
166
|
+
_iterator2.f();
|
|
122
167
|
}
|
|
123
168
|
|
|
124
169
|
return null;
|
|
125
170
|
},
|
|
126
|
-
getChildren: ()
|
|
127
|
-
|
|
171
|
+
getChildren: function getChildren() {
|
|
172
|
+
var children = [];
|
|
128
173
|
children.push(layoutHandle);
|
|
129
174
|
|
|
130
175
|
if (!_Utils.default.isNull(layoutHandle.api)) {
|
|
131
|
-
|
|
132
|
-
|
|
176
|
+
var _iterator3 = _createForOfIteratorHelper(layoutHandle.api.getChildren()),
|
|
177
|
+
_step3;
|
|
178
|
+
|
|
179
|
+
try {
|
|
180
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
181
|
+
var child = _step3.value;
|
|
182
|
+
children.push(child);
|
|
183
|
+
}
|
|
184
|
+
} catch (err) {
|
|
185
|
+
_iterator3.e(err);
|
|
186
|
+
} finally {
|
|
187
|
+
_iterator3.f();
|
|
133
188
|
}
|
|
134
189
|
}
|
|
135
190
|
|
|
136
191
|
return children;
|
|
137
192
|
},
|
|
138
|
-
updateModel: values
|
|
193
|
+
updateModel: function updateModel(values) {
|
|
139
194
|
doUpdateModel(values);
|
|
140
195
|
},
|
|
141
|
-
setModelValue: (key, value)
|
|
196
|
+
setModelValue: function setModelValue(key, value) {
|
|
142
197
|
model.key = value;
|
|
143
198
|
},
|
|
144
|
-
getModelValue: key
|
|
199
|
+
getModelValue: function getModelValue(key) {
|
|
145
200
|
return model[key];
|
|
146
201
|
}
|
|
147
202
|
};
|
|
@@ -155,7 +210,7 @@ const Dialog = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.for
|
|
|
155
210
|
}, !_Utils.default.isNull(title) ? /*#__PURE__*/_react.default.createElement(_DialogTitle.default, {
|
|
156
211
|
id: "alert-dialog-title"
|
|
157
212
|
}, title) : null, /*#__PURE__*/_react.default.createElement(_DialogContent.default, null, render(props.config.layout))));
|
|
158
|
-
}), ()
|
|
213
|
+
}), function () {
|
|
159
214
|
return true;
|
|
160
215
|
});
|
|
161
216
|
|
|
@@ -17,38 +17,55 @@ var _DocumentTemplateDesignerComponent = _interopRequireDefault(require("./Docum
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
const [visible, setVisible] = _react.default.useState(false);
|
|
20
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
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."); }
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
+
|
|
32
|
+
var DocumentTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
33
|
+
var _React$useState = _react.default.useState(false),
|
|
34
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
35
|
+
visible = _React$useState2[0],
|
|
36
|
+
setVisible = _React$useState2[1];
|
|
37
|
+
|
|
38
|
+
var _React$useState3 = _react.default.useState(null),
|
|
39
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
40
|
+
uploadTrigger = _React$useState4[0],
|
|
41
|
+
setUploadTrigger = _React$useState4[1];
|
|
42
|
+
|
|
43
|
+
_react.default.useEffect(function () {
|
|
26
44
|
props.handle.api = api();
|
|
27
45
|
});
|
|
28
46
|
|
|
29
|
-
_react.default.useEffect(()
|
|
30
|
-
|
|
47
|
+
_react.default.useEffect(function () {
|
|
48
|
+
var parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
31
49
|
|
|
32
50
|
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
|
|
33
51
|
|
|
34
52
|
_Observable.default.addSystemSubscriptions(props.viewId, parsedConfig);
|
|
35
53
|
|
|
36
54
|
props.handle.api.refresh();
|
|
37
|
-
return ()
|
|
55
|
+
return function () {
|
|
38
56
|
_Observable.default.clearComponentEventListeners(props.handle);
|
|
39
57
|
};
|
|
40
58
|
}, []);
|
|
41
59
|
|
|
42
|
-
|
|
60
|
+
var api = function api() {
|
|
43
61
|
return {
|
|
44
62
|
get id() {
|
|
45
63
|
return props.config.id;
|
|
46
64
|
},
|
|
47
65
|
|
|
48
|
-
loadData: actionConfig
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
66
|
+
loadData: function loadData(actionConfig) {},
|
|
67
|
+
refresh: function refresh() {
|
|
68
|
+
var parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
52
69
|
|
|
53
70
|
if (!_Utils.default.isNull(props.config) && !_Utils.default.isNull(parsedConfig.visible)) {
|
|
54
71
|
setVisible(_Utils.default.evaluateBooleanExpression(parsedConfig.visible, parsedConfig.id));
|
|
@@ -56,8 +73,7 @@ const DocumentTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/
|
|
|
56
73
|
setVisible(true);
|
|
57
74
|
}
|
|
58
75
|
},
|
|
59
|
-
|
|
60
|
-
getChildren: () => {
|
|
76
|
+
getChildren: function getChildren() {
|
|
61
77
|
return [];
|
|
62
78
|
},
|
|
63
79
|
|
|
@@ -65,8 +81,10 @@ const DocumentTemplateDesigner = /*#__PURE__*/_react.default.memo( /*#__PURE__*/
|
|
|
65
81
|
setVisible(visible);
|
|
66
82
|
},
|
|
67
83
|
|
|
68
|
-
handleUploadDocument: event
|
|
69
|
-
setUploadTrigger(
|
|
84
|
+
handleUploadDocument: function handleUploadDocument(event) {
|
|
85
|
+
setUploadTrigger(function (current) {
|
|
86
|
+
return !current;
|
|
87
|
+
});
|
|
70
88
|
}
|
|
71
89
|
};
|
|
72
90
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
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
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -15,30 +17,59 @@ var _mammoth = _interopRequireDefault(require("mammoth"));
|
|
|
15
17
|
|
|
16
18
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
17
19
|
|
|
20
|
+
var _this = void 0;
|
|
21
|
+
|
|
18
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
23
|
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
29
|
+
|
|
30
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
31
|
+
|
|
32
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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', '|', {
|
|
36
67
|
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>',
|
|
37
68
|
undo: true,
|
|
38
|
-
click: onClick.bind(
|
|
69
|
+
click: onClick.bind(_this),
|
|
39
70
|
tooltipText: 'Insert Placeholders'
|
|
40
71
|
}, '|', 'Undo', 'Redo'];
|
|
41
|
-
|
|
72
|
+
var toolbarSettings = {
|
|
42
73
|
items: items
|
|
43
74
|
};
|
|
44
75
|
|
|
@@ -50,37 +81,80 @@ const DocumentTemplateDesignerComponent = props => {
|
|
|
50
81
|
setOpen(true);
|
|
51
82
|
}
|
|
52
83
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
84
|
+
var handleFileChange = /*#__PURE__*/function () {
|
|
85
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(event) {
|
|
86
|
+
var file, reader;
|
|
87
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
88
|
+
while (1) {
|
|
89
|
+
switch (_context2.prev = _context2.next) {
|
|
90
|
+
case 0:
|
|
91
|
+
file = event.target.files[0];
|
|
92
|
+
setError(null);
|
|
93
|
+
|
|
94
|
+
if (file) {
|
|
95
|
+
if (file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
|
|
96
|
+
reader = new FileReader();
|
|
97
|
+
|
|
98
|
+
reader.onload = /*#__PURE__*/function () {
|
|
99
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(e) {
|
|
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();
|
|
73
147
|
}
|
|
74
|
-
}
|
|
148
|
+
}
|
|
149
|
+
}, _callee2);
|
|
150
|
+
}));
|
|
75
151
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
};
|
|
152
|
+
return function handleFileChange(_x) {
|
|
153
|
+
return _ref.apply(this, arguments);
|
|
154
|
+
};
|
|
155
|
+
}();
|
|
82
156
|
|
|
83
|
-
(0, React.useEffect)(()
|
|
157
|
+
(0, React.useEffect)(function () {
|
|
84
158
|
if (uploadTrigger != null && btnRef.current) {
|
|
85
159
|
btnRef.current.click();
|
|
86
160
|
}
|
|
@@ -101,7 +175,7 @@ const DocumentTemplateDesignerComponent = props => {
|
|
|
101
175
|
accept: ".docx"
|
|
102
176
|
})), /*#__PURE__*/React.createElement(_ej2ReactRichtexteditor.RichTextEditorComponent, {
|
|
103
177
|
id: "defaultRTE",
|
|
104
|
-
ref: scope
|
|
178
|
+
ref: function ref(scope) {
|
|
105
179
|
rteObj = scope;
|
|
106
180
|
},
|
|
107
181
|
toolbarSettings: toolbarSettings
|
|
@@ -109,7 +183,9 @@ const DocumentTemplateDesignerComponent = props => {
|
|
|
109
183
|
services: [_ej2ReactRichtexteditor.HtmlEditor, _ej2ReactRichtexteditor.Toolbar, _ej2ReactRichtexteditor.Link, _ej2ReactRichtexteditor.Image, _ej2ReactRichtexteditor.QuickToolbar]
|
|
110
184
|
})), /*#__PURE__*/React.createElement(_DocumentTemplatePlaceholderDialog.default, {
|
|
111
185
|
open: open,
|
|
112
|
-
onClose: ()
|
|
186
|
+
onClose: function onClose() {
|
|
187
|
+
return setOpen(false);
|
|
188
|
+
},
|
|
113
189
|
onInsertHandler: onInsert
|
|
114
190
|
}));
|
|
115
191
|
};
|