@agilemotion/oui-react-js 1.3.8 → 1.4.0
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/README.TXT +1 -0
- package/dist/{ApplicationContext.js → ApplicationManager.js} +334 -335
- package/dist/BasicApp.js +67 -64
- package/dist/BasicAppHome.js +90 -110
- package/dist/BusinessPortalApp.js +1 -1
- package/dist/BusinessPortalAppHome.js +15 -50
- package/dist/DynamicJS.js +24 -52
- package/dist/RestUtils.js +90 -116
- package/dist/Utils.js +49 -37
- package/dist/WithRouter.js +34 -0
- package/dist/assets/jss/components/authNavbarStyle.js +34 -35
- package/dist/assets/jss/components/cardHeaderStyle.js +12 -12
- package/dist/assets/jss/components/customDropdownStyle.js +26 -26
- package/dist/assets/jss/components/customInputStyle.js +2 -8
- package/dist/assets/jss/components/dropdownStyle.js +10 -15
- package/dist/assets/jss/components/footerStyle.js +12 -18
- package/dist/assets/jss/components/headerLinksStyle.js +7 -13
- package/dist/assets/jss/components/headerStyle.js +24 -25
- package/dist/assets/jss/components/navbarLinksStyle.js +7 -13
- package/dist/assets/jss/components/navbarStyle.js +24 -25
- package/dist/assets/jss/components/sidebarStyle.js +41 -43
- package/dist/assets/jss/components/typographyStyle.js +2 -8
- package/dist/assets/jss/rootStyle.js +32 -47
- package/dist/assets/jss/views/layoutStyle.js +6 -11
- package/dist/assets/jss/views/loginStyle.js +4 -10
- package/dist/assets/lotties/call-loading.json +1 -0
- package/dist/assets/lotties/calling-2.json +1 -0
- package/dist/assets/lotties/calling.json +1 -0
- package/dist/assets/lotties/calling2.json +1 -0
- package/dist/assets/lotties/chat.json +1 -0
- package/dist/assets/lotties/join.json +1 -0
- package/dist/assets/lotties/loading.json +1 -0
- package/dist/assets/lotties/msg2.json +1 -0
- package/dist/assets/lotties/recording.json +1 -0
- package/dist/assets/lotties/waiting.json +1 -0
- package/dist/assets/scss/black-dashboard-react/bootstrap/_card.scss +5 -5
- package/dist/assets/scss/black-dashboard-react/bootstrap/_carousel.scss +2 -2
- package/dist/assets/scss/black-dashboard-react/bootstrap/_custom-forms.scss +3 -3
- package/dist/assets/scss/black-dashboard-react/bootstrap/_functions.scss +1 -1
- package/dist/assets/scss/black-dashboard-react/bootstrap/_images.scss +1 -1
- package/dist/assets/scss/black-dashboard-react/bootstrap/_jumbotron.scss +1 -1
- package/dist/assets/scss/black-dashboard-react/bootstrap/_popover.scss +7 -5
- package/dist/assets/scss/black-dashboard-react/bootstrap/_tooltip.scss +4 -4
- package/dist/assets/scss/black-dashboard-react/bootstrap/_variables.scss +5 -5
- package/dist/assets/scss/black-dashboard-react/bootstrap/mixins/_grid-framework.scss +2 -2
- package/dist/assets/scss/black-dashboard-react/bootstrap/mixins/_grid.scss +11 -9
- package/dist/assets/scss/black-dashboard-react/bootstrap/utilities/_embed.scss +6 -4
- package/dist/assets/scss/black-dashboard-react/custom/_sidebar-and-main-panel.scss +1 -1
- package/dist/assets/scss/black-dashboard-react/custom/_variables.scss +1 -1
- package/dist/components/AlertBar.js +39 -80
- package/dist/components/AlertItem.js +4 -26
- package/dist/components/Button.js +49 -52
- package/dist/components/Calendar.js +442 -0
- package/dist/components/Calender.css +244 -0
- package/dist/components/ConfirmationDialog.js +5 -29
- package/dist/components/DataGrid.js +207 -345
- package/dist/components/DataGridColumn.js +6 -29
- package/dist/components/DataGridFilter.js +48 -116
- package/dist/components/DataGridHeading.js +11 -19
- package/dist/components/Dialog.js +27 -121
- package/dist/components/DocumentViewer.js +12 -38
- package/dist/components/DocumentViewerComponent.js +2 -20
- package/dist/components/FileThumb.js +126 -0
- package/dist/components/Graph.js +33 -75
- package/dist/components/GraphNode.js +5 -22
- package/dist/components/HtmlPanel.js +68 -82
- package/dist/components/Icon.js +107 -1
- package/dist/components/LoadingIndicator.js +4 -4
- package/dist/components/LottieIcon.js +134 -0
- package/dist/components/PopupView.js +3 -21
- package/dist/components/Portlet.js +100 -0
- package/dist/components/RegularButton.js +15 -19
- package/dist/components/SignaturePanel.js +9 -40
- package/dist/components/SocketManager.js +170 -0
- package/dist/components/StepperTitleBar.js +33 -59
- package/dist/components/TabPage.js +6 -9
- package/dist/components/TabPanel.js +49 -98
- package/dist/components/TableCellContent.js +31 -39
- package/dist/components/TemplateDesigner.js +114 -158
- package/dist/components/TemplateItemEventHandler.js +33 -100
- package/dist/components/TemplateTable.js +6 -42
- package/dist/components/TitleBar.js +38 -54
- package/dist/components/Toolbar.js +67 -182
- package/dist/components/Tree.js +29 -66
- package/dist/components/card/Card.js +16 -20
- package/dist/components/card/CardAvatar.js +9 -13
- package/dist/components/card/CardBody.js +13 -17
- package/dist/components/card/CardFooter.js +12 -16
- package/dist/components/card/CardHeader.js +13 -17
- package/dist/components/card/CardIcon.js +6 -10
- package/dist/components/card/CardText.js +6 -10
- package/dist/components/customInput/CustomInput.js +12 -10
- package/dist/components/dashboard/BasicBusinessAppDashboard.js +85 -159
- package/dist/components/dashboard/BusinessPortalAppDashboard.js +30 -75
- package/dist/components/dashboard/components/Header.js +9 -26
- package/dist/components/dashboard/components/LeftDrawer.js +3 -1
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +1 -1
- package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.css +7 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +189 -79
- package/dist/components/footer/Footer.js +6 -18
- package/dist/components/form/AddressSearch.js +32 -66
- package/dist/components/form/AutoComplete.js +161 -0
- package/dist/components/form/BaseField.js +89 -107
- package/dist/components/form/DatePicker.js +8 -23
- package/dist/components/form/FieldSet.js +161 -191
- package/dist/components/form/Form.css +1 -1
- package/dist/components/form/Form.js +153 -479
- package/dist/components/form/GridField.js +46 -146
- package/dist/components/form/IconField.js +35 -0
- package/dist/components/form/ImageEditor.js +22 -60
- package/dist/components/form/LookupField.js +8 -29
- package/dist/components/form/MultiFileUploadField.js +187 -0
- package/dist/components/form/RadioGroup.js +10 -26
- package/dist/components/form/Section.js +40 -91
- package/dist/components/form/SelectItem.js +14 -33
- package/dist/components/form/SignatureTemplateDesignerField.js +0 -1
- package/dist/components/form/Switch.js +53 -0
- package/dist/components/form/TextField.js +10 -17
- package/dist/components/form/TimePicker.js +8 -1
- package/dist/components/form/TransferList.css +2 -2
- package/dist/components/form/TransferList.js +67 -125
- package/dist/components/form/UploadField.js +132 -177
- package/dist/components/form/fieldset.css +8 -0
- package/dist/components/grid/GridContainer.js +5 -9
- package/dist/components/grid/GridItem.js +5 -9
- package/dist/components/layout/CollapsiblePanel.js +11 -33
- package/dist/components/layout/Layout.js +228 -290
- package/dist/components/layout/VC.css +17 -0
- package/dist/components/layout/View.css +18 -1
- package/dist/components/layout/View.js +80 -200
- package/dist/components/layout/ViewContainer.css +3 -0
- package/dist/components/layout/ViewContainer.js +59 -0
- package/dist/components/layout/ViewPort.js +50 -80
- package/dist/components/layout/Window.css +18 -0
- package/dist/components/layout/Window.js +287 -0
- package/dist/components/layout/WindowViewPort.js +71 -0
- package/dist/components/loader.css +1 -1
- package/dist/components/media/ClosablePanel.css +37 -0
- package/dist/components/media/ClosablePanel.js +53 -0
- package/dist/components/media/LobbyWaitingList.js +91 -0
- package/dist/components/media/MediaSoupHelper.js +223 -0
- package/dist/components/media/Recorder.js +235 -0
- package/dist/components/media/SideBarContent.css +54 -0
- package/dist/components/media/SideBarContent.js +46 -0
- package/dist/components/media/SocketRequest.js +20 -0
- package/dist/components/media/SocketResponse.js +16 -0
- package/dist/components/media/Timer.css +30 -0
- package/dist/components/media/Timer.js +88 -0
- package/dist/components/media/Toolbar.css +35 -0
- package/dist/components/media/Toolbar.js +494 -0
- package/dist/components/media/Tracks.js +39 -0
- package/dist/components/media/TrainingRoom.js +608 -0
- package/dist/components/media/Transports.js +35 -0
- package/dist/components/media/VCEventManager.js +74 -0
- package/dist/components/media/VCEventType.js +164 -0
- package/dist/components/media/VCParticipantList.css +72 -0
- package/dist/components/media/VCParticipantList.js +56 -0
- package/dist/components/media/VCParticipantListItem.css +73 -0
- package/dist/components/media/VCParticipantListItem.js +319 -0
- package/dist/components/media/VCRoom.css +42 -0
- package/dist/components/media/VCRoom.js +90 -0
- package/dist/components/media/VCRoomParticipant.css +25 -0
- package/dist/components/media/VCRoomParticipant.js +808 -0
- package/dist/components/media/VCRoomRecorder.js +223 -0
- package/dist/components/media/VCRoomWorkspace.css +86 -0
- package/dist/components/media/VCRoomWorkspace.js +666 -0
- package/dist/components/media/Video.css +4 -0
- package/dist/components/media/Video.js +131 -0
- package/dist/components/media/VideoPlayer.css +10 -0
- package/dist/components/media/VideoPlayer.js +86 -0
- package/dist/components/media/chat/ChatRoom.js +926 -0
- package/dist/components/media/chat/ChatRoomItem.js +83 -0
- package/dist/components/media/chat/ChatRoomList.js +78 -0
- package/dist/components/media/chat/ChatRooms.scss +567 -0
- package/dist/components/menu/CollapsibleMenu.js +2 -19
- package/dist/components/menu/MenuBars.js +6 -33
- package/dist/components/menu/MenuButton.js +27 -39
- package/dist/components/menu/MenuItem.js +3 -20
- package/dist/components/menu/MenuLink.js +22 -13
- package/dist/components/navbars/AuthNavbar.js +5 -18
- package/dist/components/navbars/HomeNavbar.js +5 -7
- package/dist/components/navbars/PortalNavbar.js +7 -25
- package/dist/components/signatures/AgilitySignaturePanel.js +38 -104
- package/dist/components/signatures/AlertItem.js +3 -24
- package/dist/components/signatures/DocumentContainer.js +47 -134
- package/dist/components/signatures/ImageSignatureInput.js +11 -38
- package/dist/components/signatures/MenuButton.js +1 -16
- package/dist/components/signatures/Prompt.js +3 -24
- package/dist/components/signatures/ResponsiveTable.js +42 -83
- package/dist/components/signatures/SearchView.js +13 -50
- package/dist/components/signatures/SignatorySearch.js +83 -99
- package/dist/components/signatures/SignatorySearchForm.js +11 -17
- package/dist/components/signatures/SignatureInput.js +18 -47
- package/dist/components/signatures/SignatureInputProps.js +18 -60
- package/dist/components/signatures/SignatureTemplateDesigner.js +151 -239
- package/dist/components/signatures/Toolbar.js +7 -34
- package/dist/components/signatures/ViewUtils.js +2 -6
- package/dist/components/typography/Danger.js +3 -1
- package/dist/components/typography/Info.js +3 -1
- package/dist/components/typography/Link.js +6 -2
- package/dist/event/ActionHandlers.js +6 -6
- package/dist/event/EventType.js +7 -1
- package/dist/event/LoadDataActionHandler.js +1 -1
- package/dist/event/Observable.js +80 -174
- package/dist/event/RouteActionHandler.js +74 -31
- package/dist/event/ServiceCallActionHandler.js +36 -24
- package/dist/event/SignalGraphActionHandler.js +2 -2
- package/dist/js/Addresses.js +10 -8
- package/dist/js/Calendar.js +220 -0
- package/dist/js/Media.js +157 -0
- package/dist/redux/store/ConfigureStore.js +3 -9
- package/dist/redux/store/DashboardStore.js +42 -94
- package/dist/redux/store/SecurityStore.js +15 -50
- package/dist/view/Dashboard.js +256 -171
- package/dist/view/Views.js +30 -0
- package/dist/view/security/ChangePasswordBasic.js +29 -80
- package/dist/view/security/ForgotPassword.js +13 -46
- package/dist/view/security/ForgotPasswordBasic.js +12 -45
- package/dist/view/security/Login.js +15 -51
- package/dist/view/security/LoginBasic.js +13 -46
- package/dist/view/security/LoginBusinessPortal.js +12 -45
- package/dist/view/security/ResetPassword.js +13 -51
- package/dist/view/security/ResetPasswordBasic.js +27 -75
- package/dist/view/security/Security.js +1 -0
- package/package.json +31 -25
- package/README.md +0 -1623
- package/dist/components/dashboard/BasicApp.js +0 -140
- package/dist/components/navbars/NavbarLinks.js +0 -212
- package/dist/components/signatures/OLD.js +0 -1138
- package/gulpfile.js +0 -77
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
|
|
11
|
+
|
|
12
|
+
var _BaseField = require("./BaseField");
|
|
13
|
+
|
|
14
|
+
var _Utils = _interopRequireDefault(require("../../Utils"));
|
|
15
|
+
|
|
16
|
+
var _Autocomplete = _interopRequireDefault(require("@material-ui/lab/Autocomplete"));
|
|
17
|
+
|
|
18
|
+
require("./Form.css");
|
|
19
|
+
|
|
20
|
+
var _ApplicationManager = _interopRequireDefault(require("../../ApplicationManager"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { 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 _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
|
+
|
|
30
|
+
const status = response => {
|
|
31
|
+
if (response.ok) {
|
|
32
|
+
return Promise.resolve(response);
|
|
33
|
+
} else {
|
|
34
|
+
let error = new Error(response.statusText);
|
|
35
|
+
error.code = response.status;
|
|
36
|
+
return Promise.reject(error);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const json = response => {
|
|
41
|
+
return response.text();
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const location = window.location.protocol + "//" + window.location.hostname;
|
|
45
|
+
|
|
46
|
+
const AutoCompleteWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
47
|
+
const base = props.base;
|
|
48
|
+
const value = (0, _react.useRef)([]);
|
|
49
|
+
const [inputValue, setInputValue] = (0, _react.useState)('');
|
|
50
|
+
const baseValue = (0, _react.useRef)(null);
|
|
51
|
+
const [options, setOptions] = (0, _react.useState)([]);
|
|
52
|
+
const [entityStore] = (0, _react.useState)([]);
|
|
53
|
+
|
|
54
|
+
_react.default.useEffect(() => {
|
|
55
|
+
let minLen = _Utils.default.getComponentAttribute(props.config, 'minSearchAttributeLength', 1);
|
|
56
|
+
|
|
57
|
+
if (inputValue && inputValue.length >= minLen) {
|
|
58
|
+
fetchOptions();
|
|
59
|
+
}
|
|
60
|
+
}, [inputValue]);
|
|
61
|
+
|
|
62
|
+
_react.default.useEffect(() => {
|
|
63
|
+
if (!base.value) {
|
|
64
|
+
value.current = [];
|
|
65
|
+
} else if (Array.isArray(base.value)) {
|
|
66
|
+
value.current = base.value.reduce((keys, currValue) => {
|
|
67
|
+
keys.push(currValue[props.config.attributes.searchAttribute]);
|
|
68
|
+
return keys;
|
|
69
|
+
}, []);
|
|
70
|
+
|
|
71
|
+
for (const valueElement of base.value) {
|
|
72
|
+
entityStore.push(valueElement);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
baseValue.current = base.value;
|
|
76
|
+
setOptions(value.current);
|
|
77
|
+
}
|
|
78
|
+
}, [base.value]);
|
|
79
|
+
|
|
80
|
+
const fetchOptions = () => {
|
|
81
|
+
fetch(encodeURI(location + _ApplicationManager.default.getContextRoot() + props.config.attributes.optionsUrlPath), {
|
|
82
|
+
method: 'POST',
|
|
83
|
+
headers: {
|
|
84
|
+
'Accept': 'application/json',
|
|
85
|
+
'Content-Type': 'application/json',
|
|
86
|
+
'Authorization': 'Bearer ' + sessionStorage.getItem("accessToken"),
|
|
87
|
+
'idToken': sessionStorage.getItem("idToken")
|
|
88
|
+
},
|
|
89
|
+
body: JSON.stringify({
|
|
90
|
+
"parameters": [{
|
|
91
|
+
"name": "".concat(props.config.attributes.searchAttribute),
|
|
92
|
+
"value": inputValue
|
|
93
|
+
}],
|
|
94
|
+
"pageSize": 60,
|
|
95
|
+
"currentPage": 0
|
|
96
|
+
})
|
|
97
|
+
}).then(status).then(json).then(data => {
|
|
98
|
+
let records = JSON.parse(data).records;
|
|
99
|
+
let newOptions = [];
|
|
100
|
+
|
|
101
|
+
for (const record of records) {
|
|
102
|
+
var _baseValue$current;
|
|
103
|
+
|
|
104
|
+
if (!((_baseValue$current = baseValue.current) !== null && _baseValue$current !== void 0 && _baseValue$current.find(o => o[props.config.attributes.searchAttribute] === record[props.config.attributes.searchAttribute]))) {
|
|
105
|
+
newOptions.push(record[props.config.attributes.searchAttribute]);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!entityStore.find(o => o.username === record.username)) {
|
|
109
|
+
entityStore.push(record);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
setOptions(newOptions);
|
|
114
|
+
}).catch(ignored => {});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const handleInputChange = (event, newValue) => {
|
|
118
|
+
setInputValue(newValue);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return /*#__PURE__*/_react.default.createElement(_Autocomplete.default, {
|
|
122
|
+
inputValue: inputValue,
|
|
123
|
+
multiple: true,
|
|
124
|
+
disabled: base.disabled,
|
|
125
|
+
value: value.current,
|
|
126
|
+
getOptionLabel: option => option ? option : '',
|
|
127
|
+
onInputChange: (event, newValue) => handleInputChange(event, newValue),
|
|
128
|
+
onChange: (e, newValue, reason) => {
|
|
129
|
+
let val = [];
|
|
130
|
+
|
|
131
|
+
for (const newValueElement of newValue) {
|
|
132
|
+
val.push(entityStore.find(e => e[props.config.attributes.searchAttribute] === newValueElement));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
value.current = newValue;
|
|
136
|
+
base.handleValueChange(val);
|
|
137
|
+
},
|
|
138
|
+
options: options,
|
|
139
|
+
id: props.config.id,
|
|
140
|
+
renderInput: params => /*#__PURE__*/_react.default.createElement(_TextField.default, _extends({
|
|
141
|
+
required: base.required,
|
|
142
|
+
error: base.hasError,
|
|
143
|
+
helperText: base.errorMessage,
|
|
144
|
+
variant: props.borderless ? 'standard' : 'outlined'
|
|
145
|
+
}, params, {
|
|
146
|
+
label: _Utils.default.getComponentAttribute(props.config, 'label', '')
|
|
147
|
+
}))
|
|
148
|
+
});
|
|
149
|
+
}));
|
|
150
|
+
|
|
151
|
+
const AutoComplete = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
152
|
+
return /*#__PURE__*/_react.default.createElement(_BaseField.BaseField, _extends({}, props, {
|
|
153
|
+
handle: props.handle
|
|
154
|
+
}), base => /*#__PURE__*/_react.default.createElement(AutoCompleteWrapper, _extends({
|
|
155
|
+
ref: ref,
|
|
156
|
+
base: base
|
|
157
|
+
}, props)));
|
|
158
|
+
}));
|
|
159
|
+
|
|
160
|
+
var _default = AutoComplete;
|
|
161
|
+
exports.default = _default;
|
|
@@ -11,7 +11,7 @@ var _Utils = _interopRequireDefault(require("../../Utils"));
|
|
|
11
11
|
|
|
12
12
|
var _Observable = _interopRequireDefault(require("../../event/Observable"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _ApplicationManager = _interopRequireDefault(require("../../ApplicationManager"));
|
|
15
15
|
|
|
16
16
|
var _Event = _interopRequireDefault(require("../../event/Event"));
|
|
17
17
|
|
|
@@ -21,79 +21,52 @@ var _DynamicJS = _interopRequireDefault(require("../../DynamicJS"));
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const BaseField = props => {
|
|
25
|
+
const [hasError, setHasError] = _react.default.useState(false);
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
const [errorMessage, setErrorMessage] = _react.default.useState('');
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
const [valueObject, setValueObject] = _react.default.useState({});
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
const [valueProperty, setValueProperty] = _react.default.useState(null);
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
const loadingRef = _react.default.useRef(true);
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
const [config, setConfig] = _react.default.useState(null); // TODO : Replace the state value with the valueRef below. The state value is occationaly not available in time for event scripts
|
|
35
36
|
|
|
36
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
37
|
|
|
38
|
-
const
|
|
39
|
-
const _React$useState = _react.default.useState(false),
|
|
40
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
41
|
-
hasError = _React$useState2[0],
|
|
42
|
-
setHasError = _React$useState2[1];
|
|
43
|
-
|
|
44
|
-
const _React$useState3 = _react.default.useState(""),
|
|
45
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
46
|
-
errorMessage = _React$useState4[0],
|
|
47
|
-
setErrorMessage = _React$useState4[1];
|
|
48
|
-
|
|
49
|
-
const _React$useState5 = _react.default.useState({}),
|
|
50
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
51
|
-
valueObject = _React$useState6[0],
|
|
52
|
-
setValueObject = _React$useState6[1];
|
|
53
|
-
|
|
54
|
-
const _React$useState7 = _react.default.useState(null),
|
|
55
|
-
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
56
|
-
valueProperty = _React$useState8[0],
|
|
57
|
-
setValueProperty = _React$useState8[1];
|
|
58
|
-
|
|
59
|
-
const loadingRef = _react.default.useRef(true);
|
|
38
|
+
const [value, setValue] = _react.default.useState(!_Utils.default.isNull(props.value) ? props.value : null); // TODO : Replace the state value with this ref for the reason mensioned above
|
|
60
39
|
|
|
61
|
-
const _React$useState9 = _react.default.useState(null),
|
|
62
|
-
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
63
|
-
config = _React$useState10[0],
|
|
64
|
-
setConfig = _React$useState10[1];
|
|
65
40
|
|
|
66
|
-
const
|
|
67
|
-
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
68
|
-
value = _React$useState12[0],
|
|
69
|
-
setValue = _React$useState12[1];
|
|
41
|
+
const valueRef = _react.default.useRef(!_Utils.default.isNull(props.value) ? props.value : null);
|
|
70
42
|
|
|
71
|
-
const
|
|
72
|
-
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
73
|
-
selectOptions = _React$useState14[0],
|
|
74
|
-
setSelectOptions = _React$useState14[1];
|
|
43
|
+
const [selectOptions, setSelectOptions] = _react.default.useState([]);
|
|
75
44
|
|
|
76
|
-
const
|
|
77
|
-
_React$useState16 = _slicedToArray(_React$useState15, 2),
|
|
78
|
-
disabled = _React$useState16[0],
|
|
79
|
-
setDisabled = _React$useState16[1];
|
|
45
|
+
const [disabled, setDisabled] = _react.default.useState(false);
|
|
80
46
|
|
|
81
|
-
const
|
|
82
|
-
_React$useState18 = _slicedToArray(_React$useState17, 2),
|
|
83
|
-
visible = _React$useState18[0],
|
|
84
|
-
setVisible = _React$useState18[1];
|
|
47
|
+
const [visible, setVisible] = _react.default.useState(false);
|
|
85
48
|
|
|
86
|
-
const
|
|
87
|
-
_React$useState20 = _slicedToArray(_React$useState19, 2),
|
|
88
|
-
required = _React$useState20[0],
|
|
89
|
-
setRequired = _React$useState20[1];
|
|
49
|
+
const [required, setRequired] = _react.default.useState(null);
|
|
90
50
|
|
|
91
51
|
const validateOnChange = _react.default.useRef();
|
|
92
52
|
|
|
93
53
|
const valid = _react.default.useRef(false);
|
|
94
54
|
|
|
95
55
|
_react.default.useEffect(() => {
|
|
96
|
-
|
|
56
|
+
let value = valueObject[valueProperty];
|
|
57
|
+
|
|
58
|
+
if (props.config.fieldType === 'SELECT' || props.config.fieldType === 'LOOKUP') {
|
|
59
|
+
if (!value || _Utils.default.isNull(value.id)) {
|
|
60
|
+
setValue(null);
|
|
61
|
+
valueRef.current = null;
|
|
62
|
+
} else {
|
|
63
|
+
setValue(value);
|
|
64
|
+
valueRef.current = value;
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
setValue(value);
|
|
68
|
+
valueRef.current = value;
|
|
69
|
+
}
|
|
97
70
|
}, [valueObject[valueProperty]]); // Change the required value and re-validate field if necessary
|
|
98
71
|
|
|
99
72
|
|
|
@@ -112,10 +85,10 @@ const BaseField = props => {
|
|
|
112
85
|
};
|
|
113
86
|
|
|
114
87
|
if (!_Utils.default.isNull(config.validator) && !_Utils.default.isNull(config.validator.script)) {
|
|
115
|
-
result
|
|
88
|
+
result = _DynamicJS.default.executeScriptObject("".concat(config.id, "Validator"), config.validator.script);
|
|
116
89
|
|
|
117
90
|
if (!result.valid) {
|
|
118
|
-
result.message = config.validator.message;
|
|
91
|
+
result.message = result.message ? result.message : config.validator.message;
|
|
119
92
|
}
|
|
120
93
|
}
|
|
121
94
|
|
|
@@ -123,27 +96,34 @@ const BaseField = props => {
|
|
|
123
96
|
result = _Utils.default.validateField(path.valueProperty, required, path.valueObject, currentValue, config.validator);
|
|
124
97
|
}
|
|
125
98
|
|
|
126
|
-
setErrorMessage(
|
|
127
|
-
setHasError(!result.valid &&
|
|
128
|
-
valid.current = result.valid &&
|
|
129
|
-
|
|
99
|
+
setErrorMessage(_ApplicationManager.default.isFormMarkersEnabled() ? result.message : '');
|
|
100
|
+
setHasError(!result.valid && _ApplicationManager.default.isFormMarkersEnabled());
|
|
101
|
+
valid.current = result.valid && _ApplicationManager.default.isFormMarkersEnabled();
|
|
102
|
+
|
|
103
|
+
if (_ApplicationManager.default.isFormMarkersEnabled()) {
|
|
104
|
+
props.form().setFieldError(config.id, typeof result.message === 'undefined' ? null : result.message);
|
|
105
|
+
}
|
|
106
|
+
|
|
130
107
|
return result.valid;
|
|
131
108
|
};
|
|
132
109
|
|
|
133
110
|
_react.default.useEffect(() => {
|
|
134
111
|
props.handle.api = api();
|
|
112
|
+
});
|
|
135
113
|
|
|
114
|
+
_react.default.useEffect(() => {
|
|
136
115
|
if (_Utils.default.isNull(config)) {
|
|
137
116
|
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
138
117
|
|
|
139
118
|
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
|
|
140
119
|
|
|
141
|
-
_Observable.default.addSystemSubscriptions(parsedConfig);
|
|
120
|
+
_Observable.default.addSystemSubscriptions(props.viewId, parsedConfig);
|
|
142
121
|
|
|
143
122
|
setConfig(parsedConfig);
|
|
144
123
|
setVisible(_Utils.default.evaluateBooleanExpression(parsedConfig.visible, parsedConfig.id, true));
|
|
124
|
+
setDisabled(_Utils.default.evaluateBooleanExpression(parsedConfig.disabled, parsedConfig.id, false));
|
|
145
125
|
}
|
|
146
|
-
});
|
|
126
|
+
}, []);
|
|
147
127
|
|
|
148
128
|
_react.default.useEffect(() => {
|
|
149
129
|
if (!_Utils.default.isNull(props.values) && !_Utils.default.isNull(config)) {
|
|
@@ -155,12 +135,13 @@ const BaseField = props => {
|
|
|
155
135
|
}
|
|
156
136
|
|
|
157
137
|
if (!_Utils.default.isNull(props.config.value)) {
|
|
158
|
-
let scriptValue =
|
|
138
|
+
let scriptValue = _ApplicationManager.default.isExpression(props.config.value) ? _DynamicJS.default.executeScript(props.config.id.replace('.', '_') + 'Value', props.config.value) : props.config.value;
|
|
159
139
|
|
|
160
140
|
if (!_Utils.default.isNull(scriptValue)) {
|
|
161
141
|
let val = scriptValue.instanceType === 'TypedValue' ? scriptValue.value : scriptValue;
|
|
162
142
|
valueObject[valueProperty] = val;
|
|
163
143
|
setValue(val);
|
|
144
|
+
valueRef.current = val;
|
|
164
145
|
props.form().handleChange(config.id, val);
|
|
165
146
|
}
|
|
166
147
|
}
|
|
@@ -177,10 +158,6 @@ const BaseField = props => {
|
|
|
177
158
|
setErrorMessage(field.error);
|
|
178
159
|
}
|
|
179
160
|
}
|
|
180
|
-
|
|
181
|
-
if (!_Utils.default.isNull(props.loadCompleteHandler)) {
|
|
182
|
-
props.loadCompleteHandler(config.id);
|
|
183
|
-
}
|
|
184
161
|
}
|
|
185
162
|
});
|
|
186
163
|
|
|
@@ -195,44 +172,37 @@ const BaseField = props => {
|
|
|
195
172
|
}, []);
|
|
196
173
|
|
|
197
174
|
const handleValueChange = newValue => {
|
|
198
|
-
let valueChanged = newValue !==
|
|
175
|
+
let valueChanged = newValue !== valueRef.current;
|
|
199
176
|
|
|
200
|
-
if (!_Utils.default.isNull(newValue) && !_Utils.default.isNull(
|
|
201
|
-
if (config.fieldType === 'SELECT' || config.fieldType === 'LOOKUP') {
|
|
202
|
-
valueChanged = newValue.id !==
|
|
177
|
+
if (!_Utils.default.isNull(newValue) && !_Utils.default.isNull(valueRef.current)) {
|
|
178
|
+
if (props.config.fieldType === 'SELECT' || props.config.fieldType === 'LOOKUP') {
|
|
179
|
+
valueChanged = newValue.id !== valueRef.current.id;
|
|
180
|
+
} else if (props.config.fieldType === 'DATE' || props.config.fieldType === 'TIME') {
|
|
181
|
+
valueChanged = newValue !== valueRef.current;
|
|
203
182
|
} else {
|
|
204
|
-
valueChanged = JSON.stringify(
|
|
183
|
+
valueChanged = JSON.stringify(valueRef.current) !== JSON.stringify(newValue);
|
|
205
184
|
}
|
|
206
185
|
}
|
|
207
186
|
|
|
208
187
|
if (valueChanged) {
|
|
209
|
-
let id = config.dataBinding ? config.dataBinding : config.id;
|
|
188
|
+
let id = props.config.dataBinding ? props.config.dataBinding : props.config.id;
|
|
210
189
|
|
|
211
|
-
|
|
190
|
+
_ApplicationManager.default.enableFormMarkers(true);
|
|
212
191
|
|
|
213
|
-
if (config.fieldType === 'SELECT') {
|
|
192
|
+
if (props.config.fieldType === 'SELECT') {
|
|
214
193
|
setValue(props.form().handleSelectItemChange(id, selectOptions, newValue));
|
|
194
|
+
valueRef.current = props.form().handleSelectItemChange(id, selectOptions, newValue);
|
|
215
195
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
221
|
-
const selectOption = _step.value;
|
|
222
|
-
|
|
223
|
-
if (selectOption.id === newValue) {
|
|
224
|
-
newValue = selectOption;
|
|
225
|
-
break;
|
|
226
|
-
}
|
|
196
|
+
for (const selectOption of selectOptions) {
|
|
197
|
+
if (selectOption.id === newValue) {
|
|
198
|
+
newValue = selectOption;
|
|
199
|
+
break;
|
|
227
200
|
}
|
|
228
|
-
} catch (err) {
|
|
229
|
-
_iterator.e(err);
|
|
230
|
-
} finally {
|
|
231
|
-
_iterator.f();
|
|
232
201
|
}
|
|
233
202
|
} else {
|
|
234
203
|
setValue(newValue);
|
|
235
|
-
|
|
204
|
+
valueRef.current = newValue;
|
|
205
|
+
props.form().handleChange(!_Utils.default.isNull(props.config.dataBinding) ? props.config.dataBinding : id, newValue);
|
|
236
206
|
}
|
|
237
207
|
|
|
238
208
|
if (!_Utils.default.isNull(props.valueChangeHandler)) {
|
|
@@ -278,18 +248,26 @@ const BaseField = props => {
|
|
|
278
248
|
},
|
|
279
249
|
|
|
280
250
|
get value() {
|
|
281
|
-
if (!_Utils.default.isNull(valueObject) && !_Utils.default.isNull(valueProperty)) {
|
|
251
|
+
if (!_Utils.default.isNull(valueObject) && !_Utils.default.isNull(valueProperty) && !_Utils.default.isNull(valueObject[valueProperty])) {
|
|
282
252
|
return !_Utils.default.isNull(props.valueParser) ? props.valueParser(valueObject[valueProperty], false) : valueObject[valueProperty];
|
|
283
253
|
}
|
|
284
254
|
|
|
255
|
+
if (value) {
|
|
256
|
+
if (valueObject) {
|
|
257
|
+
valueObject[valueProperty] = value;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return props.valueParser ? props.valueParser(value, false) : value;
|
|
261
|
+
}
|
|
262
|
+
|
|
285
263
|
return null;
|
|
286
264
|
},
|
|
287
265
|
|
|
288
|
-
set value(
|
|
289
|
-
handleValueChange(
|
|
266
|
+
set value(val) {
|
|
267
|
+
handleValueChange(val);
|
|
290
268
|
|
|
291
269
|
if (!_Utils.default.isNull(props.valueChangeCallback)) {
|
|
292
|
-
props.valueChangeCallback(
|
|
270
|
+
props.valueChangeCallback(val);
|
|
293
271
|
}
|
|
294
272
|
},
|
|
295
273
|
|
|
@@ -306,9 +284,11 @@ const BaseField = props => {
|
|
|
306
284
|
},
|
|
307
285
|
|
|
308
286
|
refresh() {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
287
|
+
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
288
|
+
|
|
289
|
+
setVisible(_Utils.default.evaluateBooleanExpression(parsedConfig.visible, parsedConfig.id, true));
|
|
290
|
+
setDisabled(_Utils.default.evaluateBooleanExpression(parsedConfig.disabled, parsedConfig.id));
|
|
291
|
+
let requiredNewVal = !_Utils.default.isNull(parsedConfig.validator) ? !_Utils.default.evaluateBooleanExpression(parsedConfig.validator.nullable, parsedConfig.id, true) : false;
|
|
312
292
|
validateOnChange.current = required !== null && required !== requiredNewVal && loadingRef.current === false;
|
|
313
293
|
setRequired(requiredNewVal);
|
|
314
294
|
},
|
|
@@ -317,12 +297,7 @@ const BaseField = props => {
|
|
|
317
297
|
return required;
|
|
318
298
|
},
|
|
319
299
|
|
|
320
|
-
setFieldRequired(newVal) {
|
|
321
|
-
validateOnChange.current = true;
|
|
322
|
-
setRequired(newVal);
|
|
323
|
-
},
|
|
324
|
-
|
|
325
|
-
setFieldRequired(newVal, validate) {
|
|
300
|
+
setFieldRequired(newVal, validate = true) {
|
|
326
301
|
validateOnChange.current = validate;
|
|
327
302
|
setRequired(newVal);
|
|
328
303
|
},
|
|
@@ -333,18 +308,25 @@ const BaseField = props => {
|
|
|
333
308
|
}
|
|
334
309
|
|
|
335
310
|
return [];
|
|
311
|
+
},
|
|
312
|
+
|
|
313
|
+
loadData() {
|
|
314
|
+
if (props.loadDataHandler) {
|
|
315
|
+
props.loadDataHandler();
|
|
316
|
+
}
|
|
336
317
|
}
|
|
318
|
+
|
|
337
319
|
};
|
|
338
320
|
};
|
|
339
321
|
|
|
340
322
|
return config ? /*#__PURE__*/_react.default.createElement("div", {
|
|
341
323
|
className: "col-*-*",
|
|
342
324
|
key: config.id,
|
|
343
|
-
style: {
|
|
325
|
+
style: _Utils.default.mergeStyles({
|
|
344
326
|
textAlign: 'left',
|
|
345
327
|
marginLeft: '15px',
|
|
346
328
|
display: !visible || _Utils.default.getComponentAttribute(config, 'hidden', false) === true ? 'none' : 'block'
|
|
347
|
-
}
|
|
329
|
+
}, props.config)
|
|
348
330
|
}, /*#__PURE__*/_react.default.createElement("span", null, props.children({
|
|
349
331
|
required: required,
|
|
350
332
|
disabled: disabled,
|
|
@@ -27,28 +27,10 @@ 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
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
-
|
|
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."); }
|
|
33
|
-
|
|
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); }
|
|
35
|
-
|
|
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; }
|
|
37
|
-
|
|
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; }
|
|
39
|
-
|
|
40
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
-
|
|
42
30
|
const CustomDatePickerComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
43
|
-
const
|
|
44
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
45
|
-
minDate = _React$useState2[0],
|
|
46
|
-
setMinDate = _React$useState2[1];
|
|
31
|
+
const [minDate, setMinDate] = _react.default.useState(null);
|
|
47
32
|
|
|
48
|
-
const
|
|
49
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
50
|
-
maxDate = _React$useState4[0],
|
|
51
|
-
setMaxDate = _React$useState4[1];
|
|
33
|
+
const [maxDate, setMaxDate] = _react.default.useState(null);
|
|
52
34
|
|
|
53
35
|
const base = props.base;
|
|
54
36
|
const defaultDate = !_Utils.default.isNull(base.valueObject[base.valueProperty]) ? new Date(base.valueObject[base.valueProperty]) : null;
|
|
@@ -71,7 +53,7 @@ const CustomDatePickerComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
71
53
|
};
|
|
72
54
|
|
|
73
55
|
const getLimitDate = id => {
|
|
74
|
-
let dateAttr =
|
|
56
|
+
let dateAttr = props.config[id];
|
|
75
57
|
|
|
76
58
|
if (dateAttr) {
|
|
77
59
|
if (dateAttr.toString().includes('now')) {
|
|
@@ -131,7 +113,9 @@ const CustomDatePickerComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
131
113
|
ref: ref
|
|
132
114
|
}, /*#__PURE__*/_react.default.createElement(ThemedKeyboardDatePicker, {
|
|
133
115
|
id: props.id,
|
|
134
|
-
InputProps:
|
|
116
|
+
InputProps: {
|
|
117
|
+
readOnly: true
|
|
118
|
+
},
|
|
135
119
|
disabled: base.disabled,
|
|
136
120
|
required: base.required,
|
|
137
121
|
format: "dd/MM/yyyy",
|
|
@@ -139,6 +123,7 @@ const CustomDatePickerComponent = /*#__PURE__*/_react.default.memo( /*#__PURE__*
|
|
|
139
123
|
value: base.value ? base.value : null,
|
|
140
124
|
className: props.className,
|
|
141
125
|
error: base.hasError,
|
|
126
|
+
helperText: base.errorMessage,
|
|
142
127
|
margin: "dense",
|
|
143
128
|
inputVariant: "outlined",
|
|
144
129
|
style: _Utils.default.mergeStyles({
|
|
@@ -162,7 +147,7 @@ const DatePicker = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default
|
|
|
162
147
|
return /*#__PURE__*/_react.default.createElement(_BaseField.BaseField, _extends({}, props, {
|
|
163
148
|
handle: props.handle,
|
|
164
149
|
valueParser: (value, inbound) => {
|
|
165
|
-
return !_Utils.default.isNull(value) ? inbound ? new Date(
|
|
150
|
+
return !_Utils.default.isNull(value) ? inbound ? new Date(value.toString()) : new Date(value).toLocaleDateString('en-GB').split('/').reverse().join('-') : null;
|
|
166
151
|
}
|
|
167
152
|
}), base => /*#__PURE__*/_react.default.createElement(CustomDatePickerComponent, _extends({
|
|
168
153
|
ref: ref,
|