@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
|
@@ -29,16 +29,14 @@ var _CardAvatar = _interopRequireDefault(require("../../../../card/CardAvatar"))
|
|
|
29
29
|
|
|
30
30
|
var _core = require("@material-ui/core");
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
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; }
|
|
32
|
+
var _RestUtils = require("../../../../../RestUtils");
|
|
35
33
|
|
|
36
|
-
function
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
35
|
|
|
38
36
|
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; }
|
|
39
37
|
|
|
40
38
|
let ps;
|
|
41
|
-
const TAB =
|
|
39
|
+
const TAB = 16;
|
|
42
40
|
|
|
43
41
|
const propHandler = state => {
|
|
44
42
|
let activeRouteMenu = state.dashboard.activeRouteMenu;
|
|
@@ -51,24 +49,112 @@ class Sidebar extends _react.default.Component {
|
|
|
51
49
|
constructor(props) {
|
|
52
50
|
super(props);
|
|
53
51
|
|
|
52
|
+
_defineProperty(this, "getViews", (menus, level) => {
|
|
53
|
+
let newViews = [];
|
|
54
|
+
|
|
55
|
+
for (let i = 0; i < menus.length; i++) {
|
|
56
|
+
let createView = {};
|
|
57
|
+
createView.name = menus[i].attributes.label;
|
|
58
|
+
createView.id = menus[i].id;
|
|
59
|
+
createView.mini = "SS";
|
|
60
|
+
createView.layout = "/admin";
|
|
61
|
+
createView.level = level;
|
|
62
|
+
|
|
63
|
+
if (menus[i].items && menus[i].items.length > 0) {
|
|
64
|
+
createView.collapse = true;
|
|
65
|
+
createView.state = menus[i].id + "Collapse";
|
|
66
|
+
createView.views = this.getItems(menus[i].items, level + 1);
|
|
67
|
+
} else {
|
|
68
|
+
createView.item = menus[i];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
newViews.push(createView);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
console.log("VIEWS : ", newViews, menus);
|
|
75
|
+
return newViews;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
_defineProperty(this, "getItems", (items, level) => {
|
|
79
|
+
let newItems = [];
|
|
80
|
+
|
|
81
|
+
for (let i = 0; i < items.length; i++) {
|
|
82
|
+
let createItem = {};
|
|
83
|
+
createItem.name = items[i].attributes.label;
|
|
84
|
+
createItem.id = items[i].id;
|
|
85
|
+
createItem.mini = "SS";
|
|
86
|
+
createItem.layout = "/admin";
|
|
87
|
+
createItem.item = items[i];
|
|
88
|
+
createItem.level = level;
|
|
89
|
+
|
|
90
|
+
if (!_Utils.default.isNull(items[i].subMenu)) {
|
|
91
|
+
createItem.collapse = true;
|
|
92
|
+
createItem.state = items[i].id + "SubMenuCollapse";
|
|
93
|
+
createItem.views = getItems(items[i].subMenu.items, level + 1);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
newItems.push(createItem);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return newItems;
|
|
100
|
+
});
|
|
101
|
+
|
|
54
102
|
_defineProperty(this, "getCollapseStates", routes => {
|
|
55
103
|
let initialState = {};
|
|
56
|
-
routes.map((prop, key) => {
|
|
57
|
-
if (prop.collapse) {
|
|
58
|
-
initialState = _objectSpread(_objectSpread({
|
|
59
|
-
[prop.state]: this.getCollapseInitialState(prop.views)
|
|
60
|
-
}, this.getCollapseStates(prop.views)), initialState);
|
|
61
|
-
}
|
|
62
104
|
|
|
63
|
-
|
|
64
|
-
|
|
105
|
+
if (routes) {
|
|
106
|
+
routes.map((prop, key) => {
|
|
107
|
+
if (prop.collapse) {
|
|
108
|
+
initialState = {
|
|
109
|
+
[prop.state]: this.getCollapseInitialState(prop.views),
|
|
110
|
+
...this.getCollapseStates(prop.views),
|
|
111
|
+
...initialState
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return null;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
65
119
|
return initialState;
|
|
66
120
|
});
|
|
67
121
|
|
|
122
|
+
_defineProperty(this, "getMenu", route => {
|
|
123
|
+
return new Promise(resolve => {
|
|
124
|
+
let service = {
|
|
125
|
+
url: '/ui/api/v1/menu/get',
|
|
126
|
+
parameters: [{
|
|
127
|
+
name: "id",
|
|
128
|
+
value: route.menu,
|
|
129
|
+
httpParameterType: "QUERY_PARAMETER"
|
|
130
|
+
}, {
|
|
131
|
+
name: "version",
|
|
132
|
+
value: 1.0,
|
|
133
|
+
httpParameterType: "QUERY_PARAMETER"
|
|
134
|
+
}],
|
|
135
|
+
contentType: "application/json"
|
|
136
|
+
};
|
|
137
|
+
(0, _RestUtils.invokeRest)(service, {
|
|
138
|
+
api: {
|
|
139
|
+
get id() {
|
|
140
|
+
return "dashboard-sidebar";
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
}
|
|
144
|
+
}, "dashboard-sidebar", result => {
|
|
145
|
+
resolve(this.getViews(result.menus, route.level + 1));
|
|
146
|
+
}, e => {
|
|
147
|
+
console.error(e);
|
|
148
|
+
resolve(null);
|
|
149
|
+
}, null);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
68
153
|
_defineProperty(this, "createLinks", routes => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
154
|
+
const {
|
|
155
|
+
rtlActive,
|
|
156
|
+
secondaryThemeColor
|
|
157
|
+
} = this.props;
|
|
72
158
|
return routes.map((prop, key) => {
|
|
73
159
|
if (prop.redirect) {
|
|
74
160
|
return null;
|
|
@@ -88,8 +174,19 @@ class Sidebar extends _react.default.Component {
|
|
|
88
174
|
},
|
|
89
175
|
"aria-expanded": this.state[prop.state],
|
|
90
176
|
onClick: e => {
|
|
177
|
+
if (!prop.views) {
|
|
178
|
+
this.getMenu(prop).then(views => {
|
|
179
|
+
if (views) {
|
|
180
|
+
prop.views = views; //this.getCollapseInitialState(views);
|
|
181
|
+
|
|
182
|
+
this.setState(st);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
} else {
|
|
186
|
+
this.setState(st);
|
|
187
|
+
}
|
|
188
|
+
|
|
91
189
|
e.preventDefault();
|
|
92
|
-
this.setState(st);
|
|
93
190
|
}
|
|
94
191
|
}, prop.icon !== undefined ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("i", {
|
|
95
192
|
className: prop.icon,
|
|
@@ -108,7 +205,7 @@ class Sidebar extends _react.default.Component {
|
|
|
108
205
|
}
|
|
109
206
|
}, " ", prop.name, " ", /*#__PURE__*/_react.default.createElement("b", {
|
|
110
207
|
className: "caret"
|
|
111
|
-
})), " "), " "), " ", prop.collapse ? /*#__PURE__*/_react.default.createElement(_reactstrap.Collapse, {
|
|
208
|
+
})), " "), " "), " ", prop.collapse && prop.views ? /*#__PURE__*/_react.default.createElement(_reactstrap.Collapse, {
|
|
112
209
|
isOpen: this.state[prop.state]
|
|
113
210
|
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
114
211
|
className: "nav"
|
|
@@ -118,7 +215,7 @@ class Sidebar extends _react.default.Component {
|
|
|
118
215
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
119
216
|
className: "",
|
|
120
217
|
key: key,
|
|
121
|
-
style: this.activeRoute(prop.
|
|
218
|
+
style: this.activeRoute(prop.id) ? {
|
|
122
219
|
backgroundColor: (0, _core.lighten)(secondaryThemeColor, .9),
|
|
123
220
|
borderRadius: '16px',
|
|
124
221
|
color: secondaryThemeColor,
|
|
@@ -131,29 +228,37 @@ class Sidebar extends _react.default.Component {
|
|
|
131
228
|
autoClick: prop.name === 'My Work Items' || prop.item && prop.item.defaultItem,
|
|
132
229
|
viewId: "menuBar",
|
|
133
230
|
icon: prop.icon,
|
|
134
|
-
iconColor: (prop.name === 'Dashboard' || prop.name === 'My Work Items') && this.activeRoute(prop.
|
|
231
|
+
iconColor: (prop.name === 'Dashboard' || prop.name === 'My Work Items') && this.activeRoute(prop.id) ? secondaryThemeColor : null,
|
|
135
232
|
name: prop.name,
|
|
233
|
+
id: prop.id,
|
|
136
234
|
level: prop.level,
|
|
137
|
-
|
|
235
|
+
tab: TAB,
|
|
236
|
+
color: this.activeRoute(prop.id) ? secondaryThemeColor : null
|
|
138
237
|
}), " ");
|
|
139
238
|
});
|
|
140
239
|
});
|
|
141
240
|
|
|
142
241
|
_defineProperty(this, "activeRoute", routeName => {
|
|
143
242
|
// return this.props.location.pathname.indexOf(routeName) > -1 ? "active" : "";
|
|
144
|
-
return this.props.activeRouteMenu === routeName;
|
|
243
|
+
return this.props.activeRouteMenu.id === routeName;
|
|
145
244
|
});
|
|
146
245
|
|
|
147
246
|
this.state = this.getCollapseStates(props.routes); //actionCreators.setActiveRoute(Utils.isNull(props.activeRouteMenu) ? 'Dashboard' : props.activeRouteMenu);
|
|
148
|
-
}
|
|
149
|
-
// that it gets through this.props.routes
|
|
150
|
-
|
|
247
|
+
}
|
|
151
248
|
|
|
152
249
|
// this verifies if any of the collapses should be default opened on a rerender of this component
|
|
153
250
|
// for example, on the refresh of the page,
|
|
154
251
|
// while on the src/views/forms/RegularForms.js - route /admin/regular-forms
|
|
155
252
|
getCollapseInitialState(routes) {
|
|
253
|
+
if (!routes) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
|
|
156
257
|
for (let i = 0; i < routes.length; i++) {
|
|
258
|
+
if (!routes[i].views) {
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
|
|
157
262
|
if (routes[i].collapse && this.getCollapseInitialState(routes[i].views)) {
|
|
158
263
|
return true;
|
|
159
264
|
} else if (window.location.href.indexOf(routes[i].path) !== -1) {
|
|
@@ -162,8 +267,7 @@ class Sidebar extends _react.default.Component {
|
|
|
162
267
|
}
|
|
163
268
|
|
|
164
269
|
return false;
|
|
165
|
-
}
|
|
166
|
-
|
|
270
|
+
}
|
|
167
271
|
|
|
168
272
|
componentDidMount() {
|
|
169
273
|
// if you are using a Windows Machine, the scrollbars will have a Mac look
|
|
@@ -183,9 +287,10 @@ class Sidebar extends _react.default.Component {
|
|
|
183
287
|
}
|
|
184
288
|
|
|
185
289
|
render() {
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
290
|
+
const {
|
|
291
|
+
activeColor,
|
|
292
|
+
logo
|
|
293
|
+
} = this.props;
|
|
189
294
|
let logoImg = null;
|
|
190
295
|
let logoText = null;
|
|
191
296
|
|
|
@@ -202,6 +307,9 @@ class Sidebar extends _react.default.Component {
|
|
|
202
307
|
}
|
|
203
308
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
204
309
|
src: logo.imgSrc,
|
|
310
|
+
style: {
|
|
311
|
+
width: '150px'
|
|
312
|
+
},
|
|
205
313
|
alt: "react-logo"
|
|
206
314
|
})), " ");
|
|
207
315
|
logoText = /*#__PURE__*/_react.default.createElement("a", {
|
|
@@ -23,30 +23,18 @@ var _CardAvatar = _interopRequireDefault(require("../card/CardAvatar"));
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
-
|
|
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."); }
|
|
29
|
-
|
|
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); }
|
|
31
|
-
|
|
32
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
33
|
-
|
|
34
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
-
|
|
36
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
|
|
38
26
|
const useStyles = (0, _styles.makeStyles)(_footerStyle.default);
|
|
39
27
|
|
|
40
28
|
const Footer = props => {
|
|
41
29
|
const classes = useStyles();
|
|
42
30
|
|
|
43
|
-
const
|
|
44
|
-
_React$useState2 = _slicedToArray(_React$useState, 1),
|
|
45
|
-
width = _React$useState2[0];
|
|
31
|
+
const [width] = _react.default.useState(props.width ? props.width : null);
|
|
46
32
|
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
const {
|
|
34
|
+
fluid,
|
|
35
|
+
white,
|
|
36
|
+
rtlActive
|
|
37
|
+
} = props;
|
|
50
38
|
let container = (0, _classnames.default)({
|
|
51
39
|
[classes.container]: !fluid,
|
|
52
40
|
[classes.containerFluid]: fluid,
|
|
@@ -23,48 +23,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
23
23
|
|
|
24
24
|
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); }
|
|
25
25
|
|
|
26
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
|
-
|
|
28
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
|
-
|
|
30
|
-
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(_e) { throw _e; }, 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(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
31
|
-
|
|
32
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
33
|
-
|
|
34
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
35
|
-
|
|
36
26
|
const AddressSearchWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
37
27
|
const base = props.base;
|
|
38
28
|
|
|
39
29
|
const getAddressProp = (components, id) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
45
|
-
const component = _step.value;
|
|
46
|
-
|
|
47
|
-
var _iterator2 = _createForOfIteratorHelper(component.types),
|
|
48
|
-
_step2;
|
|
49
|
-
|
|
50
|
-
try {
|
|
51
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
52
|
-
const type = _step2.value;
|
|
53
|
-
|
|
54
|
-
if (type === id) {
|
|
55
|
-
return component.long_name;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
} catch (err) {
|
|
59
|
-
_iterator2.e(err);
|
|
60
|
-
} finally {
|
|
61
|
-
_iterator2.f();
|
|
30
|
+
for (const component of components) {
|
|
31
|
+
for (const type of component.types) {
|
|
32
|
+
if (type === id) {
|
|
33
|
+
return component.long_name;
|
|
62
34
|
}
|
|
63
35
|
}
|
|
64
|
-
} catch (err) {
|
|
65
|
-
_iterator.e(err);
|
|
66
|
-
} finally {
|
|
67
|
-
_iterator.f();
|
|
68
36
|
}
|
|
69
37
|
|
|
70
38
|
return ' ';
|
|
@@ -85,36 +53,34 @@ const AddressSearchWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_rea
|
|
|
85
53
|
document.getElementById("__address_search__").value = null;
|
|
86
54
|
}
|
|
87
55
|
}, /*#__PURE__*/_react.default.createElement(_Close.default, null)) : null,
|
|
88
|
-
inputComponent: (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"country": "za"
|
|
114
|
-
}
|
|
56
|
+
inputComponent: ({
|
|
57
|
+
inputRef,
|
|
58
|
+
onFocus,
|
|
59
|
+
onBlur,
|
|
60
|
+
...props
|
|
61
|
+
}) => /*#__PURE__*/_react.default.createElement(_reactGoogleAutocomplete.default, _extends({
|
|
62
|
+
apiKey: 'AIzaSyCocunxfGatXwjt1uASpPxQ0PKcONSi7wY'
|
|
63
|
+
}, props, {
|
|
64
|
+
onPlaceSelected: place => {
|
|
65
|
+
let data = {};
|
|
66
|
+
data.googleAddress = place.formatted_address;
|
|
67
|
+
data.street = getAddressProp(place.address_components, 'street_number') + " " + getAddressProp(place.address_components, 'route');
|
|
68
|
+
data.suburb = getAddressProp(place.address_components, 'sublocality_level_1');
|
|
69
|
+
data.city = getAddressProp(place.address_components, 'locality');
|
|
70
|
+
data.municipality = getAddressProp(place.address_components, 'administrative_area_level_2');
|
|
71
|
+
data.province = getAddressProp(place.address_components, 'administrative_area_level_1');
|
|
72
|
+
data.country = getAddressProp(place.address_components, 'country');
|
|
73
|
+
data.postalCode = getAddressProp(place.address_components, 'postal_code');
|
|
74
|
+
base.handleValueChange(data);
|
|
75
|
+
document.getElementById("__address_search__").value = data.googleAddress;
|
|
76
|
+
},
|
|
77
|
+
options: {
|
|
78
|
+
types: ["geocode", "establishment"],
|
|
79
|
+
componentRestrictions: {
|
|
80
|
+
"country": "za"
|
|
115
81
|
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
82
|
+
}
|
|
83
|
+
}))
|
|
118
84
|
});
|
|
119
85
|
}));
|
|
120
86
|
|
|
@@ -124,7 +90,7 @@ const AddressSearch = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.defa
|
|
|
124
90
|
valueParser: (value, inbound) => {
|
|
125
91
|
if (!_Utils.default.isNull(value)) {
|
|
126
92
|
if (!inbound) {
|
|
127
|
-
return value.
|
|
93
|
+
return value.googleAddress;
|
|
128
94
|
}
|
|
129
95
|
}
|
|
130
96
|
|
|
@@ -0,0 +1,160 @@
|
|
|
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 _ApplicationContext = _interopRequireDefault(require("../../ApplicationContext"));
|
|
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
|
+
|
|
53
|
+
_react.default.useEffect(() => {
|
|
54
|
+
let minLen = _Utils.default.getComponentAttribute(props.config, 'minSearchAttributeLength', 1);
|
|
55
|
+
|
|
56
|
+
if (inputValue && inputValue.length >= minLen) {
|
|
57
|
+
fetchOptions();
|
|
58
|
+
}
|
|
59
|
+
}, [inputValue]);
|
|
60
|
+
|
|
61
|
+
_react.default.useEffect(() => {
|
|
62
|
+
if (!base.value) {
|
|
63
|
+
value.current = [];
|
|
64
|
+
} else if (Array.isArray(base.value)) {
|
|
65
|
+
value.current = base.value.reduce((keys, currValue) => {
|
|
66
|
+
keys.push(currValue[props.config.attributes.searchAttribute]);
|
|
67
|
+
return keys;
|
|
68
|
+
}, []);
|
|
69
|
+
baseValue.current = base.value;
|
|
70
|
+
setOptions(value.current);
|
|
71
|
+
}
|
|
72
|
+
}, [base.value]);
|
|
73
|
+
|
|
74
|
+
const fetchOptions = () => {
|
|
75
|
+
fetch(encodeURI(location + _ApplicationContext.default.getContextRoot() + props.config.attributes.optionsUrlPath), {
|
|
76
|
+
method: 'POST',
|
|
77
|
+
headers: {
|
|
78
|
+
'Accept': 'application/json',
|
|
79
|
+
'Content-Type': 'application/json',
|
|
80
|
+
'Authorization': 'Bearer ' + sessionStorage.getItem("accessToken"),
|
|
81
|
+
'idToken': sessionStorage.getItem("idToken")
|
|
82
|
+
},
|
|
83
|
+
body: JSON.stringify({
|
|
84
|
+
"parameters": [{
|
|
85
|
+
"name": "".concat(props.config.attributes.searchAttribute),
|
|
86
|
+
"value": inputValue
|
|
87
|
+
}],
|
|
88
|
+
"pageSize": 60,
|
|
89
|
+
"currentPage": 0
|
|
90
|
+
})
|
|
91
|
+
}).then(status).then(json).then(data => {
|
|
92
|
+
setOptions(JSON.parse(data).records);
|
|
93
|
+
}).catch(ignored => {});
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const handleInputChange = (event, newValue) => {
|
|
97
|
+
setInputValue(newValue);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return /*#__PURE__*/_react.default.createElement(_Autocomplete.default, {
|
|
101
|
+
inputValue: inputValue,
|
|
102
|
+
multiple: true,
|
|
103
|
+
value: value.current,
|
|
104
|
+
getOptionLabel: option => option ? option[props.config.attributes.searchAttribute] ? option[props.config.attributes.searchAttribute] : option : '',
|
|
105
|
+
onInputChange: (event, newValue) => handleInputChange(event, newValue),
|
|
106
|
+
onChange: (e, newValue, reason) => {
|
|
107
|
+
let val = [];
|
|
108
|
+
|
|
109
|
+
if (baseValue.current && Array.isArray(baseValue.current)) {
|
|
110
|
+
for (const baseValueElement of baseValue.current) {
|
|
111
|
+
if (baseValueElement) {
|
|
112
|
+
val.push(baseValueElement);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
baseValue.current = null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
for (const newValueElement of newValue) {
|
|
120
|
+
let find = options.find(o => o[props.config.attributes.searchAttribute] === newValueElement);
|
|
121
|
+
|
|
122
|
+
if (!find) {
|
|
123
|
+
var _value$current;
|
|
124
|
+
|
|
125
|
+
find = (_value$current = value.current) === null || _value$current === void 0 ? void 0 : _value$current.find(o => o[props.config.attributes.searchAttribute] === newValueElement);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (find) {
|
|
129
|
+
val.push(find);
|
|
130
|
+
} else {
|
|
131
|
+
console.error("Cannot map autocomplete key : " + newValueElement);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
value.current = newValue;
|
|
136
|
+
base.handleValueChange(val);
|
|
137
|
+
},
|
|
138
|
+
options: options.length > 0 ? options.map(option => option[props.config.attributes.searchAttribute]) : [],
|
|
139
|
+
id: props.config.id,
|
|
140
|
+
renderInput: params => /*#__PURE__*/_react.default.createElement(_TextField.default, _extends({
|
|
141
|
+
error: !_Utils.default.isNull(props.hasError) ? props.hasError : false,
|
|
142
|
+
helperText: !_Utils.default.isNull(props.errorMessage) && !_Utils.default.isNull(props.hasError) ? props.errorMessage : '',
|
|
143
|
+
variant: props.borderless ? 'standard' : 'outlined'
|
|
144
|
+
}, params, {
|
|
145
|
+
label: _Utils.default.getComponentAttribute(props.config, 'label', '')
|
|
146
|
+
}))
|
|
147
|
+
});
|
|
148
|
+
}));
|
|
149
|
+
|
|
150
|
+
const AutoComplete = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
151
|
+
return /*#__PURE__*/_react.default.createElement(_BaseField.BaseField, _extends({}, props, {
|
|
152
|
+
handle: props.handle
|
|
153
|
+
}), base => /*#__PURE__*/_react.default.createElement(AutoCompleteWrapper, _extends({
|
|
154
|
+
ref: ref,
|
|
155
|
+
base: base
|
|
156
|
+
}, props)));
|
|
157
|
+
}));
|
|
158
|
+
|
|
159
|
+
var _default = AutoComplete;
|
|
160
|
+
exports.default = _default;
|