@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,39 +21,83 @@ var _DynamicJS = _interopRequireDefault(require("../../DynamicJS"));
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
const [hasError, setHasError] = _react.default.useState(false);
|
|
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; }
|
|
34
33
|
|
|
35
|
-
|
|
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; }
|
|
36
35
|
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
var BaseField = function BaseField(props) {
|
|
39
|
+
var _React$useState = _react.default.useState(false),
|
|
40
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
41
|
+
hasError = _React$useState2[0],
|
|
42
|
+
setHasError = _React$useState2[1];
|
|
39
43
|
|
|
44
|
+
var _React$useState3 = _react.default.useState(''),
|
|
45
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
46
|
+
errorMessage = _React$useState4[0],
|
|
47
|
+
setErrorMessage = _React$useState4[1];
|
|
40
48
|
|
|
41
|
-
|
|
49
|
+
var _React$useState5 = _react.default.useState({}),
|
|
50
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
51
|
+
valueObject = _React$useState6[0],
|
|
52
|
+
setValueObject = _React$useState6[1];
|
|
42
53
|
|
|
43
|
-
|
|
54
|
+
var _React$useState7 = _react.default.useState(null),
|
|
55
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
56
|
+
valueProperty = _React$useState8[0],
|
|
57
|
+
setValueProperty = _React$useState8[1];
|
|
44
58
|
|
|
45
|
-
|
|
59
|
+
var loadingRef = _react.default.useRef(true);
|
|
46
60
|
|
|
47
|
-
|
|
61
|
+
var _React$useState9 = _react.default.useState(null),
|
|
62
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
63
|
+
config = _React$useState10[0],
|
|
64
|
+
setConfig = _React$useState10[1]; // TODO : Replace the state value with the valueRef below. The state value is occationaly not available in time for event scripts
|
|
48
65
|
|
|
49
|
-
const [required, setRequired] = _react.default.useState(null);
|
|
50
66
|
|
|
51
|
-
|
|
67
|
+
var _React$useState11 = _react.default.useState(!_Utils.default.isNull(props.value) ? props.value : null),
|
|
68
|
+
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
69
|
+
value = _React$useState12[0],
|
|
70
|
+
setValue = _React$useState12[1]; // TODO : Replace the state value with this ref for the reason mensioned above
|
|
52
71
|
|
|
53
|
-
const valid = _react.default.useRef(false);
|
|
54
72
|
|
|
55
|
-
_react.default.
|
|
56
|
-
|
|
73
|
+
var valueRef = _react.default.useRef(!_Utils.default.isNull(props.value) ? props.value : null);
|
|
74
|
+
|
|
75
|
+
var _React$useState13 = _react.default.useState([]),
|
|
76
|
+
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
77
|
+
selectOptions = _React$useState14[0],
|
|
78
|
+
setSelectOptions = _React$useState14[1];
|
|
79
|
+
|
|
80
|
+
var _React$useState15 = _react.default.useState(false),
|
|
81
|
+
_React$useState16 = _slicedToArray(_React$useState15, 2),
|
|
82
|
+
disabled = _React$useState16[0],
|
|
83
|
+
setDisabled = _React$useState16[1];
|
|
84
|
+
|
|
85
|
+
var _React$useState17 = _react.default.useState(false),
|
|
86
|
+
_React$useState18 = _slicedToArray(_React$useState17, 2),
|
|
87
|
+
visible = _React$useState18[0],
|
|
88
|
+
setVisible = _React$useState18[1];
|
|
89
|
+
|
|
90
|
+
var _React$useState19 = _react.default.useState(null),
|
|
91
|
+
_React$useState20 = _slicedToArray(_React$useState19, 2),
|
|
92
|
+
required = _React$useState20[0],
|
|
93
|
+
setRequired = _React$useState20[1];
|
|
94
|
+
|
|
95
|
+
var validateOnChange = _react.default.useRef();
|
|
96
|
+
|
|
97
|
+
var valid = _react.default.useRef(false);
|
|
98
|
+
|
|
99
|
+
_react.default.useEffect(function () {
|
|
100
|
+
var value = valueObject[valueProperty];
|
|
57
101
|
|
|
58
102
|
if (props.config.fieldType === 'SELECT' || props.config.fieldType === 'LOOKUP') {
|
|
59
103
|
if (!value || _Utils.default.isNull(value.id)) {
|
|
@@ -70,7 +114,7 @@ const BaseField = props => {
|
|
|
70
114
|
}, [valueObject[valueProperty]]); // Change the required value and re-validate field if necessary
|
|
71
115
|
|
|
72
116
|
|
|
73
|
-
_react.default.useEffect(()
|
|
117
|
+
_react.default.useEffect(function () {
|
|
74
118
|
if (!_Utils.default.isNull(config) && validateOnChange.current === true) {
|
|
75
119
|
props.form().validateParent(config.id, doValidation(props.values, value));
|
|
76
120
|
}
|
|
@@ -78,9 +122,9 @@ const BaseField = props => {
|
|
|
78
122
|
validateOnChange.current = null;
|
|
79
123
|
}, [required]);
|
|
80
124
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
125
|
+
var doValidation = function doValidation(values, currentValue) {
|
|
126
|
+
var path = props.form().getValuePath(config.id);
|
|
127
|
+
var result = {
|
|
84
128
|
valid: true
|
|
85
129
|
};
|
|
86
130
|
|
|
@@ -107,13 +151,13 @@ const BaseField = props => {
|
|
|
107
151
|
return result.valid;
|
|
108
152
|
};
|
|
109
153
|
|
|
110
|
-
_react.default.useEffect(()
|
|
154
|
+
_react.default.useEffect(function () {
|
|
111
155
|
props.handle.api = api();
|
|
112
156
|
});
|
|
113
157
|
|
|
114
|
-
_react.default.useEffect(()
|
|
158
|
+
_react.default.useEffect(function () {
|
|
115
159
|
if (_Utils.default.isNull(config)) {
|
|
116
|
-
|
|
160
|
+
var parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
117
161
|
|
|
118
162
|
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
|
|
119
163
|
|
|
@@ -125,9 +169,9 @@ const BaseField = props => {
|
|
|
125
169
|
}
|
|
126
170
|
}, []);
|
|
127
171
|
|
|
128
|
-
_react.default.useEffect(()
|
|
172
|
+
_react.default.useEffect(function () {
|
|
129
173
|
if (!_Utils.default.isNull(props.values) && !_Utils.default.isNull(config)) {
|
|
130
|
-
|
|
174
|
+
var path = props.form().getValuePath(config.id, props.values);
|
|
131
175
|
|
|
132
176
|
if (!_Utils.default.isNull(path.valueObject)) {
|
|
133
177
|
setValueObject(path.valueObject);
|
|
@@ -135,10 +179,10 @@ const BaseField = props => {
|
|
|
135
179
|
}
|
|
136
180
|
|
|
137
181
|
if (!_Utils.default.isNull(props.config.value)) {
|
|
138
|
-
|
|
182
|
+
var scriptValue = _ApplicationManager.default.isExpression(props.config.value) ? _DynamicJS.default.executeScript(props.config.id.replace('.', '_') + 'Value', props.config.value) : props.config.value;
|
|
139
183
|
|
|
140
184
|
if (!_Utils.default.isNull(scriptValue)) {
|
|
141
|
-
|
|
185
|
+
var val = scriptValue.instanceType === 'TypedValue' ? scriptValue.value : scriptValue;
|
|
142
186
|
valueObject[valueProperty] = val;
|
|
143
187
|
setValue(val);
|
|
144
188
|
valueRef.current = val;
|
|
@@ -148,9 +192,9 @@ const BaseField = props => {
|
|
|
148
192
|
}
|
|
149
193
|
}, [props.values, config]);
|
|
150
194
|
|
|
151
|
-
_react.default.useEffect(()
|
|
195
|
+
_react.default.useEffect(function () {
|
|
152
196
|
if (loadingRef.current === true && !_Utils.default.isNull(config)) {
|
|
153
|
-
|
|
197
|
+
var field = props.form().addField(config.id, props.handle, props.parentId, props.bindValueToForm);
|
|
154
198
|
|
|
155
199
|
if (!_Utils.default.isNull(field) && !_Utils.default.isNull(field.error)) {
|
|
156
200
|
if (field.error.length > 0) {
|
|
@@ -161,8 +205,8 @@ const BaseField = props => {
|
|
|
161
205
|
}
|
|
162
206
|
});
|
|
163
207
|
|
|
164
|
-
_react.default.useEffect(()
|
|
165
|
-
return ()
|
|
208
|
+
_react.default.useEffect(function () {
|
|
209
|
+
return function () {
|
|
166
210
|
if (!_Utils.default.isNull(props.form())) {
|
|
167
211
|
_Observable.default.clearComponentEventListeners(props.handle);
|
|
168
212
|
|
|
@@ -171,8 +215,8 @@ const BaseField = props => {
|
|
|
171
215
|
};
|
|
172
216
|
}, []);
|
|
173
217
|
|
|
174
|
-
|
|
175
|
-
|
|
218
|
+
var handleValueChange = function handleValueChange(newValue) {
|
|
219
|
+
var valueChanged = newValue !== valueRef.current;
|
|
176
220
|
|
|
177
221
|
if (!_Utils.default.isNull(newValue) && !_Utils.default.isNull(valueRef.current)) {
|
|
178
222
|
if (props.config.fieldType === 'SELECT' || props.config.fieldType === 'LOOKUP') {
|
|
@@ -185,7 +229,7 @@ const BaseField = props => {
|
|
|
185
229
|
}
|
|
186
230
|
|
|
187
231
|
if (valueChanged) {
|
|
188
|
-
|
|
232
|
+
var id = props.config.dataBinding ? props.config.dataBinding : props.config.id;
|
|
189
233
|
|
|
190
234
|
_ApplicationManager.default.enableFormMarkers(true);
|
|
191
235
|
|
|
@@ -193,11 +237,22 @@ const BaseField = props => {
|
|
|
193
237
|
setValue(props.form().handleSelectItemChange(id, selectOptions, newValue));
|
|
194
238
|
valueRef.current = props.form().handleSelectItemChange(id, selectOptions, newValue);
|
|
195
239
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
240
|
+
var _iterator = _createForOfIteratorHelper(selectOptions),
|
|
241
|
+
_step;
|
|
242
|
+
|
|
243
|
+
try {
|
|
244
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
245
|
+
var selectOption = _step.value;
|
|
246
|
+
|
|
247
|
+
if (selectOption.id === newValue) {
|
|
248
|
+
newValue = selectOption;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
200
251
|
}
|
|
252
|
+
} catch (err) {
|
|
253
|
+
_iterator.e(err);
|
|
254
|
+
} finally {
|
|
255
|
+
_iterator.f();
|
|
201
256
|
}
|
|
202
257
|
} else {
|
|
203
258
|
setValue(newValue);
|
|
@@ -209,18 +264,18 @@ const BaseField = props => {
|
|
|
209
264
|
props.valueChangeHandler(newValue);
|
|
210
265
|
}
|
|
211
266
|
|
|
212
|
-
|
|
267
|
+
var event = new _Event.default(props.handle, props.viewId, newValue);
|
|
213
268
|
|
|
214
269
|
_Observable.default.fireEvent(_EventType.default.VALUE_CHANGE, event);
|
|
215
270
|
}
|
|
216
271
|
};
|
|
217
272
|
|
|
218
|
-
|
|
273
|
+
var api = function api() {
|
|
219
274
|
return {
|
|
220
|
-
validate: (values, currentValue)
|
|
275
|
+
validate: function validate(values, currentValue) {
|
|
221
276
|
return doValidation(values, currentValue);
|
|
222
277
|
},
|
|
223
|
-
parseValue: (value, inbound)
|
|
278
|
+
parseValue: function parseValue(value, inbound) {
|
|
224
279
|
if (!_Utils.default.isNull(props.valueParser)) {
|
|
225
280
|
return props.valueParser(value, inbound);
|
|
226
281
|
}
|
|
@@ -236,10 +291,10 @@ const BaseField = props => {
|
|
|
236
291
|
return props.config.id;
|
|
237
292
|
},
|
|
238
293
|
|
|
239
|
-
getValidationGroup: ()
|
|
294
|
+
getValidationGroup: function getValidationGroup() {
|
|
240
295
|
return !_Utils.default.isNull(config.validator) ? config.validator.group : null;
|
|
241
296
|
},
|
|
242
|
-
clear: ()
|
|
297
|
+
clear: function clear() {
|
|
243
298
|
handleValueChange(null);
|
|
244
299
|
|
|
245
300
|
if (!_Utils.default.isNull(props.clearHandler)) {
|
|
@@ -279,16 +334,15 @@ const BaseField = props => {
|
|
|
279
334
|
setVisible(visible);
|
|
280
335
|
},
|
|
281
336
|
|
|
282
|
-
handleLoadComplete() {
|
|
337
|
+
handleLoadComplete: function handleLoadComplete() {
|
|
283
338
|
loadingRef.current = false;
|
|
284
339
|
},
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
340
|
+
refresh: function refresh() {
|
|
341
|
+
var parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
288
342
|
|
|
289
343
|
setVisible(_Utils.default.evaluateBooleanExpression(parsedConfig.visible, parsedConfig.id, true));
|
|
290
344
|
setDisabled(_Utils.default.evaluateBooleanExpression(parsedConfig.disabled, parsedConfig.id));
|
|
291
|
-
|
|
345
|
+
var requiredNewVal = !_Utils.default.isNull(parsedConfig.validator) ? !_Utils.default.evaluateBooleanExpression(parsedConfig.validator.nullable, parsedConfig.id, true) : false;
|
|
292
346
|
validateOnChange.current = required !== null && required !== requiredNewVal && loadingRef.current === false;
|
|
293
347
|
setRequired(requiredNewVal);
|
|
294
348
|
},
|
|
@@ -297,25 +351,23 @@ const BaseField = props => {
|
|
|
297
351
|
return required;
|
|
298
352
|
},
|
|
299
353
|
|
|
300
|
-
setFieldRequired(newVal
|
|
354
|
+
setFieldRequired: function setFieldRequired(newVal) {
|
|
355
|
+
var validate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
301
356
|
validateOnChange.current = validate;
|
|
302
357
|
setRequired(newVal);
|
|
303
358
|
},
|
|
304
|
-
|
|
305
|
-
getChildren: () => {
|
|
359
|
+
getChildren: function getChildren() {
|
|
306
360
|
if (!_Utils.default.isNull(props.getChildren)) {
|
|
307
361
|
return props.getChildren();
|
|
308
362
|
}
|
|
309
363
|
|
|
310
364
|
return [];
|
|
311
365
|
},
|
|
312
|
-
|
|
313
|
-
loadData() {
|
|
366
|
+
loadData: function loadData() {
|
|
314
367
|
if (props.loadDataHandler) {
|
|
315
368
|
props.loadDataHandler();
|
|
316
369
|
}
|
|
317
370
|
}
|
|
318
|
-
|
|
319
371
|
};
|
|
320
372
|
};
|
|
321
373
|
|
|
@@ -19,8 +19,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
19
19
|
|
|
20
20
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
var CheckboxWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
23
|
+
var base = props.base;
|
|
24
24
|
return /*#__PURE__*/_react.default.createElement(_FormControlLabel.default, {
|
|
25
25
|
ref: ref,
|
|
26
26
|
control: /*#__PURE__*/_react.default.createElement(_Checkbox.default, {
|
|
@@ -29,7 +29,7 @@ const CheckboxWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.de
|
|
|
29
29
|
key: props.key,
|
|
30
30
|
value: base.value || false,
|
|
31
31
|
disabled: base.disabled,
|
|
32
|
-
onChange: e
|
|
32
|
+
onChange: function onChange(e) {
|
|
33
33
|
base.handleValueChange(e.target.checked);
|
|
34
34
|
},
|
|
35
35
|
error: props.base.errorMessage,
|
|
@@ -40,13 +40,15 @@ const CheckboxWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.de
|
|
|
40
40
|
});
|
|
41
41
|
}));
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
var Checkbox = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
44
44
|
return /*#__PURE__*/_react.default.createElement(_BaseField.BaseField, _extends({}, props, {
|
|
45
45
|
handle: props.handle
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
}), function (base) {
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(CheckboxWrapper, _extends({
|
|
48
|
+
ref: ref,
|
|
49
|
+
base: base
|
|
50
|
+
}, props));
|
|
51
|
+
});
|
|
50
52
|
}));
|
|
51
53
|
|
|
52
54
|
var _default = Checkbox;
|
|
@@ -27,45 +27,63 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
27
27
|
|
|
28
28
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
const [minDate, setMinDate] = _react.default.useState(null);
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
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."); }
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
const defaultDate = !_Utils.default.isNull(base.valueObject[base.valueProperty]) ? new Date(base.valueObject[base.valueProperty]) : null;
|
|
34
|
+
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
35
|
|
|
38
|
-
|
|
36
|
+
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
37
|
|
|
40
|
-
|
|
38
|
+
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
39
|
|
|
42
|
-
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
42
|
+
var CustomDatePickerComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
43
|
+
var _React$useState = _react.default.useState(null),
|
|
44
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
45
|
+
minDate = _React$useState2[0],
|
|
46
|
+
setMinDate = _React$useState2[1];
|
|
47
|
+
|
|
48
|
+
var _React$useState3 = _react.default.useState(null),
|
|
49
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
50
|
+
maxDate = _React$useState4[0],
|
|
51
|
+
setMaxDate = _React$useState4[1];
|
|
52
|
+
|
|
53
|
+
var base = props.base;
|
|
54
|
+
var defaultDate = !_Utils.default.isNull(base.valueObject[base.valueProperty]) ? new Date(base.valueObject[base.valueProperty]) : null;
|
|
55
|
+
|
|
56
|
+
var minWidth = _Utils.default.getComponentAttribute(props.config, 'minWidth', '240px');
|
|
57
|
+
|
|
58
|
+
var width = _Utils.default.getComponentAttribute(props.config, 'width', '100%');
|
|
59
|
+
|
|
60
|
+
var handleDateChange = function handleDateChange(date) {
|
|
43
61
|
base.setValue(date);
|
|
44
62
|
base.handleValueChange(date);
|
|
45
63
|
};
|
|
46
64
|
|
|
47
|
-
_react.default.useEffect(()
|
|
65
|
+
_react.default.useEffect(function () {
|
|
48
66
|
base.setValue(defaultDate);
|
|
49
67
|
}, [props.base.valueObject[props.base.valueProperty]]);
|
|
50
68
|
|
|
51
|
-
|
|
69
|
+
var formatNumber = function formatNumber(n) {
|
|
52
70
|
return n < 10 ? '0' + n : n;
|
|
53
71
|
};
|
|
54
72
|
|
|
55
|
-
|
|
56
|
-
|
|
73
|
+
var getLimitDate = function getLimitDate(id) {
|
|
74
|
+
var dateAttr = props.config[id];
|
|
57
75
|
|
|
58
76
|
if (dateAttr) {
|
|
59
77
|
if (dateAttr.toString().includes('now')) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
78
|
+
var operator = dateAttr.toString().includes("-") ? '-' : '+';
|
|
79
|
+
var tokens = dateAttr.toString().split(operator);
|
|
80
|
+
var days = 0;
|
|
63
81
|
|
|
64
82
|
if (tokens.length > 0 && !_Utils.default.isNull(tokens[1])) {
|
|
65
83
|
days = parseFloat(tokens[1].replace('d', '').trim());
|
|
66
84
|
}
|
|
67
85
|
|
|
68
|
-
|
|
86
|
+
var limit = new Date();
|
|
69
87
|
|
|
70
88
|
if ("-" === operator) {
|
|
71
89
|
limit.setDate(limit.getDate() - days);
|
|
@@ -80,7 +98,7 @@ const CustomDatePickerComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
80
98
|
return id === "minDate" ? "1970-01-01" : "9000-12-31";
|
|
81
99
|
};
|
|
82
100
|
|
|
83
|
-
_react.default.useEffect(()
|
|
101
|
+
_react.default.useEffect(function () {
|
|
84
102
|
if (minDate === null) {
|
|
85
103
|
setMinDate(getLimitDate("minDate"));
|
|
86
104
|
}
|
|
@@ -90,8 +108,10 @@ const CustomDatePickerComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
90
108
|
}
|
|
91
109
|
});
|
|
92
110
|
|
|
93
|
-
|
|
94
|
-
|
|
111
|
+
var secondaryColor = (0, _reactRedux.useSelector)(function (state) {
|
|
112
|
+
return state.dashboard.secondaryThemeColor;
|
|
113
|
+
});
|
|
114
|
+
var ThemedKeyboardDatePicker = (0, _styles.withStyles)({
|
|
95
115
|
root: {
|
|
96
116
|
'& label.Mui-focused': {
|
|
97
117
|
color: secondaryColor
|
|
@@ -143,16 +163,18 @@ const CustomDatePickerComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
143
163
|
})));
|
|
144
164
|
}));
|
|
145
165
|
|
|
146
|
-
|
|
166
|
+
var DatePicker = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
147
167
|
return /*#__PURE__*/_react.default.createElement(_BaseField.BaseField, _extends({}, props, {
|
|
148
168
|
handle: props.handle,
|
|
149
|
-
valueParser: (value, inbound)
|
|
169
|
+
valueParser: function valueParser(value, inbound) {
|
|
150
170
|
return !_Utils.default.isNull(value) ? inbound ? new Date(value.toString()) : new Date(value).toLocaleDateString('en-GB').split('/').reverse().join('-') : null;
|
|
151
171
|
}
|
|
152
|
-
}),
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
172
|
+
}), function (base) {
|
|
173
|
+
return /*#__PURE__*/_react.default.createElement(CustomDatePickerComponent, _extends({
|
|
174
|
+
ref: ref,
|
|
175
|
+
base: base
|
|
176
|
+
}, props));
|
|
177
|
+
});
|
|
156
178
|
}));
|
|
157
179
|
|
|
158
180
|
var _default = DatePicker;
|