@agilemotion/oui-react-js 1.3.8 → 1.3.9
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 +161 -284
- package/dist/BasicApp.js +1 -1
- package/dist/BasicAppHome.js +17 -4
- package/dist/BusinessPortalApp.js +1 -1
- package/dist/BusinessPortalAppHome.js +10 -39
- package/dist/DynamicJS.js +20 -52
- package/dist/RestUtils.js +83 -108
- package/dist/Utils.js +36 -30
- 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/_variables.scss +1 -1
- package/dist/components/AlertBar.js +39 -80
- package/dist/components/AlertItem.js +4 -26
- package/dist/components/Button.js +24 -36
- package/dist/components/Calendar.js +478 -0
- package/dist/components/Calender.css +244 -0
- package/dist/components/ConfirmationDialog.js +5 -29
- package/dist/components/DataGrid.js +169 -338
- package/dist/components/DataGridColumn.js +5 -28
- package/dist/components/DataGridFilter.js +46 -114
- package/dist/components/DataGridHeading.js +11 -19
- package/dist/components/Dialog.js +27 -121
- package/dist/components/DocumentViewer.js +8 -34
- package/dist/components/DocumentViewerComponent.js +2 -20
- package/dist/components/FileThumb.js +115 -0
- package/dist/components/Graph.js +25 -75
- package/dist/components/GraphNode.js +4 -21
- package/dist/components/HtmlPanel.js +59 -78
- package/dist/components/Icon.js +99 -1
- package/dist/components/LoadingIndicator.js +4 -4
- package/dist/components/LottieIcon.js +134 -0
- package/dist/components/PopupView.js +2 -20
- 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 +30 -56
- package/dist/components/TabPage.js +6 -9
- package/dist/components/TabPanel.js +41 -98
- package/dist/components/TableCellContent.js +30 -38
- package/dist/components/TemplateDesigner.js +107 -151
- package/dist/components/TemplateItemEventHandler.js +33 -100
- package/dist/components/TemplateTable.js +6 -42
- package/dist/components/TitleBar.js +35 -52
- package/dist/components/Toolbar.js +33 -179
- package/dist/components/Tree.js +27 -64
- 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 +79 -155
- package/dist/components/dashboard/BusinessPortalAppDashboard.js +30 -75
- package/dist/components/dashboard/components/Header.js +8 -25
- 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.js +138 -30
- package/dist/components/footer/Footer.js +6 -18
- package/dist/components/form/AddressSearch.js +32 -66
- package/dist/components/form/AutoComplete.js +160 -0
- package/dist/components/form/BaseField.js +66 -96
- package/dist/components/form/DatePicker.js +3 -21
- package/dist/components/form/FieldSet.js +158 -180
- package/dist/components/form/Form.css +1 -1
- package/dist/components/form/Form.js +137 -471
- package/dist/components/form/GridField.js +46 -146
- package/dist/components/form/IconField.js +35 -0
- package/dist/components/form/ImageEditor.js +19 -57
- package/dist/components/form/LookupField.js +8 -29
- package/dist/components/form/MultiFileUploadField.js +186 -0
- package/dist/components/form/RadioGroup.js +1 -16
- package/dist/components/form/Section.js +31 -92
- 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 +7 -1
- package/dist/components/form/TransferList.css +2 -2
- package/dist/components/form/TransferList.js +67 -125
- package/dist/components/form/UploadField.js +27 -79
- 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 +175 -290
- package/dist/components/layout/VC.css +17 -0
- package/dist/components/layout/View.css +17 -1
- package/dist/components/layout/View.js +77 -194
- 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 +20 -0
- package/dist/components/media/Toolbar.js +470 -0
- package/dist/components/media/Tracks.js +39 -0
- package/dist/components/media/TrainingRoom.js +531 -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 +806 -0
- package/dist/components/media/VCRoomWorkspace.css +86 -0
- package/dist/components/media/VCRoomWorkspace.js +653 -0
- package/dist/components/media/Video.css +4 -0
- package/dist/components/media/Video.js +131 -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 +7 -35
- package/dist/components/menu/MenuItem.js +3 -20
- package/dist/components/menu/MenuLink.js +18 -12
- package/dist/components/navbars/AuthNavbar.js +5 -18
- package/dist/components/navbars/HomeNavbar.js +3 -5
- package/dist/components/navbars/PortalNavbar.js +4 -22
- package/dist/components/signatures/AgilitySignaturePanel.js +35 -101
- package/dist/components/signatures/AlertItem.js +3 -24
- package/dist/components/signatures/DocumentContainer.js +47 -134
- package/dist/components/signatures/ImageSignatureInput.js +8 -35
- 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 +15 -44
- package/dist/components/signatures/SignatureInputProps.js +18 -60
- package/dist/components/signatures/SignatureTemplateDesigner.js +147 -235
- 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 +3 -3
- package/dist/event/EventType.js +7 -1
- package/dist/event/LoadDataActionHandler.js +1 -1
- package/dist/event/Observable.js +56 -168
- package/dist/event/RouteActionHandler.js +45 -11
- package/dist/event/ServiceCallActionHandler.js +34 -24
- package/dist/js/Addresses.js +10 -8
- 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 +242 -163
- package/dist/view/security/ChangePasswordBasic.js +23 -76
- package/dist/view/security/ForgotPassword.js +9 -42
- package/dist/view/security/ForgotPasswordBasic.js +8 -41
- package/dist/view/security/Login.js +11 -47
- package/dist/view/security/LoginBasic.js +8 -41
- package/dist/view/security/LoginBusinessPortal.js +8 -41
- package/dist/view/security/ResetPassword.js +9 -47
- package/dist/view/security/ResetPasswordBasic.js +21 -71
- package/dist/view/security/Security.js +1 -0
- package/package.json +29 -13
- 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
|
@@ -33,37 +33,13 @@ var _Event = _interopRequireDefault(require("../../event/Event"));
|
|
|
33
33
|
|
|
34
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
35
|
|
|
36
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
-
|
|
38
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
39
|
-
|
|
40
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
|
-
|
|
42
|
-
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); } }
|
|
43
|
-
|
|
44
|
-
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); }); }; }
|
|
45
|
-
|
|
46
|
-
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; } } }; }
|
|
47
|
-
|
|
48
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
49
|
-
|
|
50
|
-
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."); }
|
|
51
|
-
|
|
52
|
-
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); }
|
|
53
|
-
|
|
54
|
-
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; }
|
|
55
|
-
|
|
56
|
-
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; }
|
|
57
|
-
|
|
58
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
59
|
-
|
|
60
36
|
const useStyles = (0, _styles.makeStyles)(theme => ({
|
|
61
37
|
container: {
|
|
62
38
|
display: 'flex',
|
|
63
39
|
flexWrap: 'wrap',
|
|
64
40
|
width: '100%',
|
|
65
|
-
|
|
66
|
-
verticalAlign:
|
|
41
|
+
'& tr td': {
|
|
42
|
+
verticalAlign: 'top'
|
|
67
43
|
}
|
|
68
44
|
},
|
|
69
45
|
select: {
|
|
@@ -78,51 +54,24 @@ const useStyles = (0, _styles.makeStyles)(theme => ({
|
|
|
78
54
|
}));
|
|
79
55
|
|
|
80
56
|
const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
81
|
-
const
|
|
82
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
83
|
-
values = _React$useState2[0],
|
|
84
|
-
setValues = _React$useState2[1];
|
|
57
|
+
const values = _react.default.useRef(!_Utils.default.isNull(props.values) ? props.values : {});
|
|
85
58
|
|
|
86
|
-
const
|
|
87
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
88
|
-
masterValues = _React$useState4[0],
|
|
89
|
-
setMasterValues = _React$useState4[1];
|
|
59
|
+
const [masterValues, setMasterValues] = _react.default.useState(null);
|
|
90
60
|
|
|
91
|
-
const
|
|
92
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
93
|
-
config = _React$useState6[0],
|
|
94
|
-
setConfig = _React$useState6[1];
|
|
61
|
+
const [config, setConfig] = _react.default.useState(_Utils.default.parseConfig(props.config, props.viewId));
|
|
95
62
|
|
|
96
|
-
const
|
|
97
|
-
_React$useState8 = _slicedToArray(_React$useState7, 1),
|
|
98
|
-
binder = _React$useState8[0];
|
|
63
|
+
const [binder] = _react.default.useState(_Utils.default.isNull(props.config.binder) ? 'PLAIN_OBJECT' : props.config.binder);
|
|
99
64
|
|
|
100
|
-
const
|
|
101
|
-
_React$useState10 = _slicedToArray(_React$useState9, 1),
|
|
102
|
-
fields = _React$useState10[0];
|
|
65
|
+
const [fields] = _react.default.useState([]);
|
|
103
66
|
|
|
104
67
|
const containerErrorCallback = _react.default.useRef();
|
|
105
68
|
|
|
106
|
-
const
|
|
107
|
-
_React$useState12 = _slicedToArray(_React$useState11, 1),
|
|
108
|
-
sectionHandles = _React$useState12[0];
|
|
109
|
-
|
|
110
|
-
const _React$useState13 = _react.default.useState([]),
|
|
111
|
-
_React$useState14 = _slicedToArray(_React$useState13, 1),
|
|
112
|
-
loadedComponents = _React$useState14[0];
|
|
69
|
+
const [sectionHandles] = _react.default.useState({});
|
|
113
70
|
|
|
114
|
-
const
|
|
115
|
-
_React$useState16 = _slicedToArray(_React$useState15, 1),
|
|
116
|
-
fieldParentErrors = _React$useState16[0];
|
|
71
|
+
const [fieldParentErrors] = _react.default.useState({});
|
|
117
72
|
|
|
118
73
|
const loadingRef = _react.default.useRef(true);
|
|
119
74
|
|
|
120
|
-
const _React$useState17 = _react.default.useState(true),
|
|
121
|
-
_React$useState18 = _slicedToArray(_React$useState17, 2),
|
|
122
|
-
initializing = _React$useState18[0],
|
|
123
|
-
setInitializing = _React$useState18[1];
|
|
124
|
-
|
|
125
|
-
const mutex = new _asyncMutex.Mutex();
|
|
126
75
|
let sectionCounter = 0;
|
|
127
76
|
|
|
128
77
|
const api = () => {
|
|
@@ -141,22 +90,22 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
141
90
|
doHandleChange(id, value);
|
|
142
91
|
},
|
|
143
92
|
handleSelectItemChange: (name, options, selectedId) => {
|
|
144
|
-
return
|
|
93
|
+
return handleSelectItemChange(name, options, selectedId);
|
|
145
94
|
},
|
|
146
95
|
handleChange: (id, value) => {
|
|
147
96
|
doHandleChange(id, value);
|
|
148
97
|
},
|
|
149
98
|
getValuePath: (id, values) => {
|
|
150
|
-
return
|
|
99
|
+
return getValuePath(id, values);
|
|
151
100
|
},
|
|
152
101
|
addField: (id, ref, parentId, bindValueToForm) => {
|
|
153
|
-
return
|
|
102
|
+
return addField(id, ref, parentId, bindValueToForm);
|
|
154
103
|
},
|
|
155
104
|
removeField: id => {
|
|
156
|
-
|
|
105
|
+
removeField(id);
|
|
157
106
|
},
|
|
158
107
|
loadData: (actionConfig, event) => {
|
|
159
|
-
|
|
108
|
+
loadData(actionConfig, config, event ? event.data : null);
|
|
160
109
|
},
|
|
161
110
|
bindData: data => {
|
|
162
111
|
doBindData(data);
|
|
@@ -196,7 +145,7 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
196
145
|
},
|
|
197
146
|
|
|
198
147
|
get model() {
|
|
199
|
-
return values;
|
|
148
|
+
return values.current;
|
|
200
149
|
},
|
|
201
150
|
|
|
202
151
|
set model(model) {
|
|
@@ -207,58 +156,39 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
207
156
|
get value() {
|
|
208
157
|
if (loadingRef.current === false) {
|
|
209
158
|
let data = null;
|
|
210
|
-
let currentValue = values;
|
|
211
159
|
let valid = true;
|
|
212
|
-
|
|
160
|
+
data = {};
|
|
161
|
+
let map = !_Utils.default.isNull(masterValues) ? JSON.parse(JSON.stringify(masterValues)) : {};
|
|
213
162
|
|
|
214
|
-
if (
|
|
215
|
-
|
|
216
|
-
|
|
163
|
+
if (_Utils.default.isNull(map.id)) {
|
|
164
|
+
map.id = values.current.id;
|
|
165
|
+
}
|
|
217
166
|
|
|
218
|
-
|
|
219
|
-
|
|
167
|
+
for (const field of fields) {
|
|
168
|
+
if (field.bindValueToForm === false) {
|
|
169
|
+
continue;
|
|
220
170
|
}
|
|
221
171
|
|
|
222
|
-
|
|
223
|
-
_step;
|
|
224
|
-
|
|
225
|
-
try {
|
|
226
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
227
|
-
const field = _step.value;
|
|
228
|
-
|
|
229
|
-
if (field.bindValueToForm === false) {
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
let fieldValid = field.handle.api.validate(values, null);
|
|
172
|
+
let fieldValid = field.handle.api.validate(values.current, null);
|
|
234
173
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
map[id] = field.handle.api.parseValue(path.valueObject[path.valueProperty], false);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
} catch (err) {
|
|
248
|
-
_iterator.e(err);
|
|
249
|
-
} finally {
|
|
250
|
-
_iterator.f();
|
|
174
|
+
if (fieldValid === false) {
|
|
175
|
+
console.log("INVALID : " + field.id);
|
|
176
|
+
doValidateParent(field, !fieldValid, false);
|
|
177
|
+
valid = false;
|
|
178
|
+
} else if (valid) {
|
|
179
|
+
let id = field.id;
|
|
180
|
+
let path = getValuePath(id, values.current);
|
|
181
|
+
path.valueObject[path.valueProperty] = field.handle.api.parseValue(path.valueObject[path.valueProperty], false);
|
|
251
182
|
}
|
|
183
|
+
}
|
|
252
184
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
} else {
|
|
259
|
-
data = values;
|
|
185
|
+
data = values.current;
|
|
186
|
+
|
|
187
|
+
if (!_Utils.default.isNull(containerErrorCallback.current) && _ApplicationContext.default.isFormMarkersEnabled()) {
|
|
188
|
+
containerErrorCallback.current(fieldParentErrors);
|
|
260
189
|
}
|
|
261
190
|
|
|
191
|
+
console.log("FORM : " + valid);
|
|
262
192
|
return valid ? data : null;
|
|
263
193
|
}
|
|
264
194
|
|
|
@@ -266,7 +196,7 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
266
196
|
},
|
|
267
197
|
|
|
268
198
|
setFieldError: (id, error) => {
|
|
269
|
-
return
|
|
199
|
+
return setFieldError(id, error);
|
|
270
200
|
},
|
|
271
201
|
getChildren: () => {
|
|
272
202
|
let children = [];
|
|
@@ -283,33 +213,13 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
283
213
|
|
|
284
214
|
let properties = Object.getOwnPropertyNames(sectionHandles);
|
|
285
215
|
|
|
286
|
-
|
|
287
|
-
|
|
216
|
+
for (const property of properties) {
|
|
217
|
+
let sectionHandle = sectionHandles[property];
|
|
218
|
+
children.push(sectionHandle);
|
|
288
219
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
const property = _step2.value;
|
|
292
|
-
let sectionHandle = sectionHandles[property];
|
|
293
|
-
children.push(sectionHandle);
|
|
294
|
-
|
|
295
|
-
var _iterator3 = _createForOfIteratorHelper(sectionHandle.api.getChildren()),
|
|
296
|
-
_step3;
|
|
297
|
-
|
|
298
|
-
try {
|
|
299
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
300
|
-
const child = _step3.value;
|
|
301
|
-
children.push(child);
|
|
302
|
-
}
|
|
303
|
-
} catch (err) {
|
|
304
|
-
_iterator3.e(err);
|
|
305
|
-
} finally {
|
|
306
|
-
_iterator3.f();
|
|
307
|
-
}
|
|
220
|
+
for (const child of sectionHandle.api.getChildren()) {
|
|
221
|
+
children.push(child);
|
|
308
222
|
}
|
|
309
|
-
} catch (err) {
|
|
310
|
-
_iterator2.e(err);
|
|
311
|
-
} finally {
|
|
312
|
-
_iterator2.f();
|
|
313
223
|
}
|
|
314
224
|
|
|
315
225
|
return children;
|
|
@@ -318,22 +228,12 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
318
228
|
refresh() {
|
|
319
229
|
let properties = Object.getOwnPropertyNames(sectionHandles);
|
|
320
230
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
try {
|
|
325
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
326
|
-
const property = _step4.value;
|
|
327
|
-
let sectionHandle = sectionHandles[property];
|
|
231
|
+
for (const property of properties) {
|
|
232
|
+
let sectionHandle = sectionHandles[property];
|
|
328
233
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
234
|
+
if (sectionHandle.api.refresh) {
|
|
235
|
+
sectionHandle.api.refresh();
|
|
332
236
|
}
|
|
333
|
-
} catch (err) {
|
|
334
|
-
_iterator4.e(err);
|
|
335
|
-
} finally {
|
|
336
|
-
_iterator4.f();
|
|
337
237
|
}
|
|
338
238
|
}
|
|
339
239
|
|
|
@@ -371,28 +271,17 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
371
271
|
|
|
372
272
|
_Observable.default.processSystemGeneratedSubscriptions(props.config.id);
|
|
373
273
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
try {
|
|
378
|
-
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
379
|
-
const field = _step5.value;
|
|
380
|
-
|
|
381
|
-
_Observable.default.processSystemGeneratedSubscriptions(field.handle.api.id);
|
|
382
|
-
}
|
|
383
|
-
} catch (err) {
|
|
384
|
-
_iterator5.e(err);
|
|
385
|
-
} finally {
|
|
386
|
-
_iterator5.f();
|
|
274
|
+
for (const field of fields) {
|
|
275
|
+
_Observable.default.processSystemGeneratedSubscriptions(field.handle.api.id);
|
|
387
276
|
}
|
|
388
277
|
}
|
|
389
278
|
|
|
390
|
-
function
|
|
279
|
+
function loadData(eventConfig, componentConfig, eventData = null) {
|
|
391
280
|
let service = !_Utils.default.isNull(componentConfig.dataService) ? componentConfig.dataService : eventConfig !== null ? eventConfig.dataService : null;
|
|
392
|
-
let componentValue = !_Utils.default.isNull(componentConfig.value) ? componentConfig.value : eventConfig !== null ? eventConfig.value : null;
|
|
281
|
+
let componentValue = !_Utils.default.isNull(componentConfig.value) ? _ApplicationContext.default.resolveParameterConfigValue(componentConfig.value, eventData) : eventConfig !== null ? _ApplicationContext.default.resolveParameterConfigValue(eventConfig.value, eventData) : null;
|
|
393
282
|
|
|
394
283
|
if (!_Utils.default.isNull(service)) {
|
|
395
|
-
if (service.type === '
|
|
284
|
+
if (service.type === 'rpc') {
|
|
396
285
|
(0, _RestUtils.invokeRpc)(service, props.handle, props.viewId, result => {
|
|
397
286
|
try {
|
|
398
287
|
if (!_Utils.default.isNull(result.data)) {
|
|
@@ -431,7 +320,11 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
431
320
|
return true;
|
|
432
321
|
} else {
|
|
433
322
|
if (!_Utils.default.isNull(componentValue)) {
|
|
434
|
-
|
|
323
|
+
if (!_ApplicationContext.default.isExpression(componentValue)) {
|
|
324
|
+
componentValue = _ApplicationContext.default.fillEventDataValue(componentValue, eventData);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
let isEventData = componentValue.toString().startsWith('$event.data');
|
|
435
328
|
|
|
436
329
|
if (_ApplicationContext.default.isExpression(componentValue) && !isEventData) {
|
|
437
330
|
let path = _Utils.default.getPropertyChainPath(componentValue);
|
|
@@ -473,39 +366,54 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
473
366
|
}
|
|
474
367
|
}
|
|
475
368
|
|
|
369
|
+
_react.default.useEffect(() => {
|
|
370
|
+
return () => {
|
|
371
|
+
props.handle.api = null;
|
|
372
|
+
};
|
|
373
|
+
}, []);
|
|
374
|
+
|
|
476
375
|
_react.default.useEffect(() => {
|
|
477
376
|
props.handle.api = api();
|
|
377
|
+
});
|
|
478
378
|
|
|
479
|
-
|
|
480
|
-
|
|
379
|
+
_react.default.useEffect(() => {
|
|
380
|
+
let eventHandlingConfig = _Utils.default.isNull(config.eventHandlingConfig) ? {} : config.eventHandlingConfig;
|
|
381
|
+
eventHandlingConfig.subscriptions = _Utils.default.isNull(eventHandlingConfig.subscriptions) ? [] : eventHandlingConfig.subscriptions;
|
|
382
|
+
|
|
383
|
+
let autoLoadData = _Utils.default.getComponentAttribute(config, 'autoLoadData', null);
|
|
384
|
+
|
|
385
|
+
if (autoLoadData === null || autoLoadData === true) {
|
|
386
|
+
let subscription = {
|
|
387
|
+
publisher: props.viewId,
|
|
388
|
+
eventType: _EventType.default.COMPONENT_LOAD,
|
|
389
|
+
actions: [{
|
|
390
|
+
actionType: 'loadData'
|
|
391
|
+
}]
|
|
392
|
+
};
|
|
393
|
+
eventHandlingConfig.subscriptions.push(subscription);
|
|
394
|
+
} else {
|
|
395
|
+
handleDataArrived();
|
|
396
|
+
}
|
|
481
397
|
|
|
482
|
-
|
|
483
|
-
eventHandlingConfig.subscriptions = _Utils.default.isNull(eventHandlingConfig.subscriptions) ? [] : eventHandlingConfig.subscriptions;
|
|
398
|
+
_Observable.default.addSubscriptions(eventHandlingConfig, props.handle, props.viewId);
|
|
484
399
|
|
|
485
|
-
|
|
400
|
+
_Observable.default.addSystemSubscriptions(config);
|
|
486
401
|
|
|
487
|
-
|
|
488
|
-
let subscription = {
|
|
489
|
-
publisher: props.viewId,
|
|
490
|
-
eventType: _EventType.default.COMPONENT_LOAD,
|
|
491
|
-
actions: [{
|
|
492
|
-
actionType: "loadData"
|
|
493
|
-
}]
|
|
494
|
-
};
|
|
495
|
-
eventHandlingConfig.subscriptions.push(subscription);
|
|
496
|
-
} else {
|
|
497
|
-
loadingRef.current = false;
|
|
498
|
-
handleDataArrived();
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
_Observable.default.addSubscriptions(eventHandlingConfig, props.handle, props.viewId);
|
|
402
|
+
setConfig(config);
|
|
502
403
|
|
|
503
|
-
|
|
404
|
+
for (const field of fields) {
|
|
405
|
+
let handle = field.handle;
|
|
504
406
|
|
|
505
|
-
|
|
506
|
-
|
|
407
|
+
if (!_Utils.default.isNull(handle)) {
|
|
408
|
+
handle.api.handleLoadComplete();
|
|
409
|
+
}
|
|
507
410
|
}
|
|
508
|
-
|
|
411
|
+
|
|
412
|
+
loadingRef.current = false;
|
|
413
|
+
let event = new _Event.default(props.handle, props.viewId, null);
|
|
414
|
+
|
|
415
|
+
_Observable.default.fireEvent(_EventType.default.COMPONENT_LOAD, event);
|
|
416
|
+
}, []);
|
|
509
417
|
|
|
510
418
|
_react.default.useEffect(() => {
|
|
511
419
|
if (!_Utils.default.isNull(props.config) && !_Utils.default.isNull(props.values)) {
|
|
@@ -522,259 +430,19 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
522
430
|
const getFieldsFromTab = tab => {
|
|
523
431
|
let fields = [];
|
|
524
432
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
const tabPage = _step6.value;
|
|
531
|
-
|
|
532
|
-
var _iterator7 = _createForOfIteratorHelper(tabPage.components),
|
|
533
|
-
_step7;
|
|
534
|
-
|
|
535
|
-
try {
|
|
536
|
-
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
537
|
-
const component = _step7.value;
|
|
538
|
-
|
|
539
|
-
if (component.type === "formSection") {
|
|
540
|
-
var _iterator8 = _createForOfIteratorHelper(component.components),
|
|
541
|
-
_step8;
|
|
542
|
-
|
|
543
|
-
try {
|
|
544
|
-
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
545
|
-
const fieldset = _step8.value;
|
|
546
|
-
fields = fields.concat(fieldset.fields);
|
|
547
|
-
}
|
|
548
|
-
} catch (err) {
|
|
549
|
-
_iterator8.e(err);
|
|
550
|
-
} finally {
|
|
551
|
-
_iterator8.f();
|
|
552
|
-
}
|
|
553
|
-
}
|
|
433
|
+
for (const tabPage of tab.tabPages) {
|
|
434
|
+
for (const component of tabPage.components) {
|
|
435
|
+
if (component.type === 'formSection') {
|
|
436
|
+
for (const fieldset of component.components) {
|
|
437
|
+
fields = fields.concat(fieldset.fields);
|
|
554
438
|
}
|
|
555
|
-
} catch (err) {
|
|
556
|
-
_iterator7.e(err);
|
|
557
|
-
} finally {
|
|
558
|
-
_iterator7.f();
|
|
559
439
|
}
|
|
560
440
|
}
|
|
561
|
-
} catch (err) {
|
|
562
|
-
_iterator6.e(err);
|
|
563
|
-
} finally {
|
|
564
|
-
_iterator6.f();
|
|
565
441
|
}
|
|
566
442
|
|
|
567
443
|
return fields;
|
|
568
444
|
};
|
|
569
445
|
|
|
570
|
-
function loadCompleteHandler(_x) {
|
|
571
|
-
return _loadCompleteHandler.apply(this, arguments);
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
function _loadCompleteHandler() {
|
|
575
|
-
_loadCompleteHandler = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(id) {
|
|
576
|
-
var release, allLoaded, _iterator9, _step9, section, _iterator11, _step11, component, fields, _iterator12, _step12, field, _iterator10, _step10, handle, event;
|
|
577
|
-
|
|
578
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
579
|
-
while (1) switch (_context.prev = _context.next) {
|
|
580
|
-
case 0:
|
|
581
|
-
if (_Utils.default.isNull(id)) {
|
|
582
|
-
_context.next = 68;
|
|
583
|
-
break;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
_context.next = 3;
|
|
587
|
-
return mutex.acquire();
|
|
588
|
-
|
|
589
|
-
case 3:
|
|
590
|
-
release = _context.sent;
|
|
591
|
-
_context.prev = 4;
|
|
592
|
-
|
|
593
|
-
if (loadedComponents.includes(id)) {
|
|
594
|
-
_context.next = 65;
|
|
595
|
-
break;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
loadedComponents.push(id);
|
|
599
|
-
allLoaded = true;
|
|
600
|
-
_iterator9 = _createForOfIteratorHelper(props.config.sections);
|
|
601
|
-
_context.prev = 9;
|
|
602
|
-
|
|
603
|
-
_iterator9.s();
|
|
604
|
-
|
|
605
|
-
case 11:
|
|
606
|
-
if ((_step9 = _iterator9.n()).done) {
|
|
607
|
-
_context.next = 55;
|
|
608
|
-
break;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
section = _step9.value;
|
|
612
|
-
_iterator11 = _createForOfIteratorHelper(section.components);
|
|
613
|
-
_context.prev = 14;
|
|
614
|
-
|
|
615
|
-
_iterator11.s();
|
|
616
|
-
|
|
617
|
-
case 16:
|
|
618
|
-
if ((_step11 = _iterator11.n()).done) {
|
|
619
|
-
_context.next = 43;
|
|
620
|
-
break;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
component = _step11.value;
|
|
624
|
-
fields = null;
|
|
625
|
-
|
|
626
|
-
if (component.type === 'tab') {
|
|
627
|
-
fields = getFieldsFromTab(component);
|
|
628
|
-
} else if (component.type === 'fieldSet') {
|
|
629
|
-
fields = component.fields;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
if (!fields) {
|
|
633
|
-
_context.next = 39;
|
|
634
|
-
break;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
_iterator12 = _createForOfIteratorHelper(fields);
|
|
638
|
-
_context.prev = 22;
|
|
639
|
-
|
|
640
|
-
_iterator12.s();
|
|
641
|
-
|
|
642
|
-
case 24:
|
|
643
|
-
if ((_step12 = _iterator12.n()).done) {
|
|
644
|
-
_context.next = 31;
|
|
645
|
-
break;
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
field = _step12.value;
|
|
649
|
-
|
|
650
|
-
if (loadedComponents.includes(field.id)) {
|
|
651
|
-
_context.next = 29;
|
|
652
|
-
break;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
allLoaded = false;
|
|
656
|
-
return _context.abrupt("break", 31);
|
|
657
|
-
|
|
658
|
-
case 29:
|
|
659
|
-
_context.next = 24;
|
|
660
|
-
break;
|
|
661
|
-
|
|
662
|
-
case 31:
|
|
663
|
-
_context.next = 36;
|
|
664
|
-
break;
|
|
665
|
-
|
|
666
|
-
case 33:
|
|
667
|
-
_context.prev = 33;
|
|
668
|
-
_context.t0 = _context["catch"](22);
|
|
669
|
-
|
|
670
|
-
_iterator12.e(_context.t0);
|
|
671
|
-
|
|
672
|
-
case 36:
|
|
673
|
-
_context.prev = 36;
|
|
674
|
-
|
|
675
|
-
_iterator12.f();
|
|
676
|
-
|
|
677
|
-
return _context.finish(36);
|
|
678
|
-
|
|
679
|
-
case 39:
|
|
680
|
-
if (allLoaded) {
|
|
681
|
-
_context.next = 41;
|
|
682
|
-
break;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
return _context.abrupt("break", 43);
|
|
686
|
-
|
|
687
|
-
case 41:
|
|
688
|
-
_context.next = 16;
|
|
689
|
-
break;
|
|
690
|
-
|
|
691
|
-
case 43:
|
|
692
|
-
_context.next = 48;
|
|
693
|
-
break;
|
|
694
|
-
|
|
695
|
-
case 45:
|
|
696
|
-
_context.prev = 45;
|
|
697
|
-
_context.t1 = _context["catch"](14);
|
|
698
|
-
|
|
699
|
-
_iterator11.e(_context.t1);
|
|
700
|
-
|
|
701
|
-
case 48:
|
|
702
|
-
_context.prev = 48;
|
|
703
|
-
|
|
704
|
-
_iterator11.f();
|
|
705
|
-
|
|
706
|
-
return _context.finish(48);
|
|
707
|
-
|
|
708
|
-
case 51:
|
|
709
|
-
if (allLoaded) {
|
|
710
|
-
_context.next = 53;
|
|
711
|
-
break;
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
return _context.abrupt("break", 55);
|
|
715
|
-
|
|
716
|
-
case 53:
|
|
717
|
-
_context.next = 11;
|
|
718
|
-
break;
|
|
719
|
-
|
|
720
|
-
case 55:
|
|
721
|
-
_context.next = 60;
|
|
722
|
-
break;
|
|
723
|
-
|
|
724
|
-
case 57:
|
|
725
|
-
_context.prev = 57;
|
|
726
|
-
_context.t2 = _context["catch"](9);
|
|
727
|
-
|
|
728
|
-
_iterator9.e(_context.t2);
|
|
729
|
-
|
|
730
|
-
case 60:
|
|
731
|
-
_context.prev = 60;
|
|
732
|
-
|
|
733
|
-
_iterator9.f();
|
|
734
|
-
|
|
735
|
-
return _context.finish(60);
|
|
736
|
-
|
|
737
|
-
case 63:
|
|
738
|
-
if (allLoaded) {
|
|
739
|
-
_iterator10 = _createForOfIteratorHelper(fields);
|
|
740
|
-
|
|
741
|
-
try {
|
|
742
|
-
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
743
|
-
field = _step10.value;
|
|
744
|
-
handle = field.handle;
|
|
745
|
-
|
|
746
|
-
if (!_Utils.default.isNull(handle)) {
|
|
747
|
-
handle.api.handleLoadComplete();
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
} catch (err) {
|
|
751
|
-
_iterator10.e(err);
|
|
752
|
-
} finally {
|
|
753
|
-
_iterator10.f();
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
if (allLoaded && !_Utils.default.isNull(props.loadCompleteHandler)) {
|
|
758
|
-
props.loadCompleteHandler(props.config.id);
|
|
759
|
-
event = new _Event.default(props.handle, props.viewId, null);
|
|
760
|
-
|
|
761
|
-
_Observable.default.fireEvent(_EventType.default.COMPONENT_LOAD, event);
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
case 65:
|
|
765
|
-
_context.prev = 65;
|
|
766
|
-
release();
|
|
767
|
-
return _context.finish(65);
|
|
768
|
-
|
|
769
|
-
case 68:
|
|
770
|
-
case "end":
|
|
771
|
-
return _context.stop();
|
|
772
|
-
}
|
|
773
|
-
}, _callee, null, [[4,, 65, 68], [9, 57, 60, 63], [14, 45, 48, 51], [22, 33, 36, 39]]);
|
|
774
|
-
}));
|
|
775
|
-
return _loadCompleteHandler.apply(this, arguments);
|
|
776
|
-
}
|
|
777
|
-
|
|
778
446
|
const transformDataObject = data => {
|
|
779
447
|
let formValues = null;
|
|
780
448
|
|
|
@@ -823,10 +491,10 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
823
491
|
field.handle.api.clear();
|
|
824
492
|
}
|
|
825
493
|
|
|
826
|
-
values.
|
|
494
|
+
values.current = {};
|
|
827
495
|
|
|
828
496
|
if (!_Utils.default.isNull(props.valueChangeHandler)) {
|
|
829
|
-
props.valueChangeHandler(
|
|
497
|
+
props.valueChangeHandler({});
|
|
830
498
|
}
|
|
831
499
|
}
|
|
832
500
|
|
|
@@ -836,8 +504,7 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
836
504
|
data = data.map;
|
|
837
505
|
}
|
|
838
506
|
|
|
839
|
-
for (
|
|
840
|
-
const key = _Object$keys[_i2];
|
|
507
|
+
for (const key of Object.keys(data)) {
|
|
841
508
|
let field = getField(key);
|
|
842
509
|
|
|
843
510
|
if (!_Utils.default.isNull(field)) {
|
|
@@ -852,19 +519,17 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
852
519
|
|
|
853
520
|
for (let i = 0; i < fields.length; i++) {
|
|
854
521
|
let field = fields[i];
|
|
855
|
-
|
|
856
|
-
let path = _getValuePath(field.id, parsedValues);
|
|
857
|
-
|
|
522
|
+
let path = getValuePath(field.id, parsedValues);
|
|
858
523
|
let objectValue = path.valueObject[path.valueProperty];
|
|
859
524
|
|
|
860
525
|
if (!_Utils.default.isNull(field.handle.api)) {
|
|
861
526
|
path.valueObject[path.valueProperty] = field.handle.api.parseValue(objectValue, true);
|
|
862
527
|
} else {
|
|
863
|
-
console.error(
|
|
528
|
+
console.error('NULL field reference while parsing form value - ' + field.id);
|
|
864
529
|
}
|
|
865
530
|
}
|
|
866
531
|
|
|
867
|
-
|
|
532
|
+
values.current = parsedValues;
|
|
868
533
|
|
|
869
534
|
if (!_Utils.default.isNull(props.dataArrivedHandler)) {
|
|
870
535
|
props.dataArrivedHandler(parsedValues);
|
|
@@ -891,7 +556,7 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
891
556
|
return null;
|
|
892
557
|
};
|
|
893
558
|
|
|
894
|
-
const
|
|
559
|
+
const removeField = id => {
|
|
895
560
|
for (let i = 0; i < fields.length; i++) {
|
|
896
561
|
if (fields[i].id === id) {
|
|
897
562
|
fields.splice(i, 1);
|
|
@@ -899,9 +564,7 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
899
564
|
}
|
|
900
565
|
};
|
|
901
566
|
|
|
902
|
-
function doValidateParent(field, invalid) {
|
|
903
|
-
let hasErrors = false;
|
|
904
|
-
|
|
567
|
+
function doValidateParent(field, invalid, updateErrors = true) {
|
|
905
568
|
if (!_Utils.default.isNull(field.parentId)) {
|
|
906
569
|
let isParentInvalid = invalid;
|
|
907
570
|
|
|
@@ -911,21 +574,22 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
911
574
|
}
|
|
912
575
|
}
|
|
913
576
|
|
|
914
|
-
hasErrors = hasErrors || isParentInvalid;
|
|
915
577
|
fieldParentErrors[field.parentId] = isParentInvalid;
|
|
916
578
|
}
|
|
917
579
|
|
|
918
|
-
if (!_Utils.default.isNull(containerErrorCallback.current) && _ApplicationContext.default.isFormMarkersEnabled()) {
|
|
580
|
+
if (updateErrors && !_Utils.default.isNull(containerErrorCallback.current) && _ApplicationContext.default.isFormMarkersEnabled()) {
|
|
919
581
|
containerErrorCallback.current(fieldParentErrors);
|
|
920
582
|
}
|
|
583
|
+
|
|
584
|
+
return fieldParentErrors;
|
|
921
585
|
}
|
|
922
586
|
|
|
923
587
|
const validateField = (field, id, value) => {
|
|
924
588
|
if (loadingRef.current === false) {
|
|
925
589
|
field.error = null;
|
|
926
|
-
let invalid = field.handle.api.validate(
|
|
590
|
+
let invalid = field.handle.api.validate({ ...values.current,
|
|
927
591
|
[id]: value
|
|
928
|
-
}
|
|
592
|
+
}, value) === false;
|
|
929
593
|
doValidateParent(field, invalid);
|
|
930
594
|
return invalid;
|
|
931
595
|
}
|
|
@@ -933,16 +597,16 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
933
597
|
return true;
|
|
934
598
|
};
|
|
935
599
|
|
|
936
|
-
const
|
|
600
|
+
const getValuePath = (id, vals) => {
|
|
937
601
|
let path = {};
|
|
938
602
|
let currentValues = vals;
|
|
939
603
|
|
|
940
604
|
if (_Utils.default.isNull(vals)) {
|
|
941
|
-
currentValues = values;
|
|
605
|
+
currentValues = values.current;
|
|
942
606
|
}
|
|
943
607
|
|
|
944
608
|
if (!_Utils.default.isNull(currentValues)) {
|
|
945
|
-
let tokens = id.split(
|
|
609
|
+
let tokens = id.split('.');
|
|
946
610
|
|
|
947
611
|
if (tokens.length === 1) {
|
|
948
612
|
path.valueObject = currentValues;
|
|
@@ -970,7 +634,7 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
970
634
|
};
|
|
971
635
|
|
|
972
636
|
const doHandleChange = (id, value) => {
|
|
973
|
-
let path =
|
|
637
|
+
let path = getValuePath(id, null);
|
|
974
638
|
|
|
975
639
|
if (!_Utils.default.isNull(path.valueObject) && !_Utils.default.isNull(path.valueProperty) && loadingRef.current === false) {
|
|
976
640
|
path.valueObject[path.valueProperty] = value;
|
|
@@ -987,8 +651,7 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
987
651
|
if (!_Utils.default.isNull(validationGroup)) {
|
|
988
652
|
if (field !== groupField && validationGroup === field.handle.api.getValidationGroup()) {
|
|
989
653
|
let groupFieldId = groupField.handle.api.id;
|
|
990
|
-
|
|
991
|
-
let gridFieldPath = _getValuePath(groupFieldId, null);
|
|
654
|
+
let gridFieldPath = getValuePath(groupFieldId, null);
|
|
992
655
|
|
|
993
656
|
if (!_Utils.default.isNull(gridFieldPath)) {
|
|
994
657
|
let groupFieldVal = gridFieldPath.valueObject[gridFieldPath.valueProperty];
|
|
@@ -1000,20 +663,20 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
1000
663
|
}
|
|
1001
664
|
|
|
1002
665
|
if (!_Utils.default.isNull(props.valueChangeHandler)) {
|
|
1003
|
-
props.valueChangeHandler(invalid ? null : values, id, value);
|
|
666
|
+
props.valueChangeHandler(invalid ? null : values.current, id, value);
|
|
1004
667
|
}
|
|
1005
668
|
}
|
|
1006
669
|
|
|
1007
|
-
let isMarkersEnabled = _ApplicationContext.default.isFormMarkersEnabled();
|
|
1008
|
-
|
|
1009
670
|
_ApplicationContext.default.enableFormMarkers(false);
|
|
1010
671
|
|
|
1011
672
|
_Observable.default.processSystemGeneratedSubscriptions(props.config.id);
|
|
1012
673
|
|
|
1013
|
-
|
|
674
|
+
let event = new _Event.default(props.handle, props.viewId, values.current);
|
|
675
|
+
|
|
676
|
+
_Observable.default.fireEvent(_EventType.default.VALUE_CHANGE, event);
|
|
1014
677
|
};
|
|
1015
678
|
|
|
1016
|
-
const
|
|
679
|
+
const setFieldError = (id, error) => {
|
|
1017
680
|
let field = getField(id);
|
|
1018
681
|
|
|
1019
682
|
if (!_Utils.default.isNull(field)) {
|
|
@@ -1021,14 +684,13 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
1021
684
|
}
|
|
1022
685
|
};
|
|
1023
686
|
|
|
1024
|
-
const
|
|
687
|
+
const addField = (id, handle, parentId, bindValueToForm) => {
|
|
1025
688
|
let field = getField(id);
|
|
1026
689
|
let error = null;
|
|
1027
690
|
|
|
1028
691
|
if (!_Utils.default.isNull(field)) {
|
|
1029
692
|
error = field.error;
|
|
1030
|
-
|
|
1031
|
-
_removeField(id);
|
|
693
|
+
removeField(id);
|
|
1032
694
|
}
|
|
1033
695
|
|
|
1034
696
|
field = {};
|
|
@@ -1038,10 +700,15 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
1038
700
|
field.bindValueToForm = bindValueToForm;
|
|
1039
701
|
field.parentId = parentId;
|
|
1040
702
|
fields.push(field);
|
|
703
|
+
|
|
704
|
+
if (values.current) {
|
|
705
|
+
parseValues(values.current);
|
|
706
|
+
}
|
|
707
|
+
|
|
1041
708
|
return field;
|
|
1042
709
|
};
|
|
1043
710
|
|
|
1044
|
-
const
|
|
711
|
+
const handleSelectItemChange = (name, options, selectedId) => {
|
|
1045
712
|
let selectedValue = null;
|
|
1046
713
|
|
|
1047
714
|
for (let i = 0; i < options.length; i++) {
|
|
@@ -1055,9 +722,9 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
1055
722
|
};
|
|
1056
723
|
|
|
1057
724
|
const updateValue = (name, value) => {
|
|
1058
|
-
props.valueChangeHandler(
|
|
725
|
+
props.valueChangeHandler({ ...values.current,
|
|
1059
726
|
[name]: value
|
|
1060
|
-
})
|
|
727
|
+
});
|
|
1061
728
|
};
|
|
1062
729
|
|
|
1063
730
|
function render(form) {
|
|
@@ -1073,12 +740,11 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
1073
740
|
config: section,
|
|
1074
741
|
handle: createSectionHandle(section),
|
|
1075
742
|
ref: /*#__PURE__*/_react.default.createRef(),
|
|
1076
|
-
loadCompleteHandler: loadCompleteHandler,
|
|
1077
743
|
form: () => {
|
|
1078
744
|
return !_Utils.default.isNull(props.handle.api) ? props.handle.api : api();
|
|
1079
745
|
},
|
|
1080
746
|
viewId: props.viewId,
|
|
1081
|
-
values: values
|
|
747
|
+
values: values.current
|
|
1082
748
|
}));
|
|
1083
749
|
}));
|
|
1084
750
|
}
|
|
@@ -1092,7 +758,7 @@ const Form = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
1092
758
|
overflow: 'auto',
|
|
1093
759
|
maxHeight: '70vh'
|
|
1094
760
|
}, props.config) : null
|
|
1095
|
-
}, !_Utils.default.isNull(props.config.id) ?
|
|
761
|
+
}, !_Utils.default.isNull(props.config.id) ? render(props.config) : /*#__PURE__*/_react.default.createElement("div", null, "ERROR: A form must have an ID"));
|
|
1096
762
|
}));
|
|
1097
763
|
|
|
1098
764
|
var _default = Form;
|