@dexteel/mesf-core 3.2.0 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account/login.d.ts +0 -6
- package/dist/index.esm.js +20 -25
- package/package.json +6 -4
- package/dist/index.esm.js.map +0 -1
package/dist/account/login.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { LoginParams } from "./models/login.models";
|
|
4
3
|
export declare function Login({ authConfig }: LoginParams): JSX.Element;
|
|
5
|
-
export declare namespace Login {
|
|
6
|
-
var propTypes: {
|
|
7
|
-
setToken: PropTypes.Requireable<(...args: any[]) => any>;
|
|
8
|
-
};
|
|
9
|
-
}
|
package/dist/index.esm.js
CHANGED
|
@@ -38,7 +38,7 @@ import FormHelperText$1 from '@material-ui/core/FormHelperText';
|
|
|
38
38
|
import stc from 'string-to-color';
|
|
39
39
|
import DeleteIcon from '@material-ui/icons/Delete';
|
|
40
40
|
import EditIcon from '@material-ui/icons/Edit';
|
|
41
|
-
import { Outlet,
|
|
41
|
+
import { Outlet, useNavigate, useSearchParams, Link, useParams, Navigate, Routes, Route, BrowserRouter } from 'react-router-dom';
|
|
42
42
|
import PropTypes from 'prop-types';
|
|
43
43
|
import { ResponsiveBar } from '@nivo/bar';
|
|
44
44
|
import DatePicker from 'react-datepicker';
|
|
@@ -3820,7 +3820,7 @@ var Configuration$1 = /** @class */ (function () {
|
|
|
3820
3820
|
return Configuration;
|
|
3821
3821
|
}());
|
|
3822
3822
|
|
|
3823
|
-
var base$
|
|
3823
|
+
var base$1 = document.getElementsByTagName('base')[0].getAttribute('href') || '/';
|
|
3824
3824
|
var MESApiService = /** @class */ (function () {
|
|
3825
3825
|
function MESApiService() {
|
|
3826
3826
|
this.config = new Configuration$1();
|
|
@@ -3984,7 +3984,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
3984
3984
|
})
|
|
3985
3985
|
.then(function (response) {
|
|
3986
3986
|
if (response.status === 401) {
|
|
3987
|
-
window.location.href = "".concat(base$
|
|
3987
|
+
window.location.href = "".concat(base$1, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
3988
3988
|
}
|
|
3989
3989
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
3990
3990
|
return response.json();
|
|
@@ -4036,7 +4036,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4036
4036
|
})
|
|
4037
4037
|
.then(function (response) {
|
|
4038
4038
|
if (response.status === 401) {
|
|
4039
|
-
window.location.href = "".concat(base$
|
|
4039
|
+
window.location.href = "".concat(base$1, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4040
4040
|
}
|
|
4041
4041
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
4042
4042
|
return response.json();
|
|
@@ -4091,7 +4091,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4091
4091
|
})
|
|
4092
4092
|
.then(function (response) {
|
|
4093
4093
|
if (response.status === 401) {
|
|
4094
|
-
window.location.href = "".concat(base$
|
|
4094
|
+
window.location.href = "".concat(base$1, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4095
4095
|
}
|
|
4096
4096
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
4097
4097
|
return response.json();
|
|
@@ -4144,7 +4144,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4144
4144
|
})
|
|
4145
4145
|
.then(function (response) {
|
|
4146
4146
|
if (response.status === 401) {
|
|
4147
|
-
window.location.href = "".concat(base$
|
|
4147
|
+
window.location.href = "".concat(base$1, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4148
4148
|
}
|
|
4149
4149
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
4150
4150
|
if (!isError.ok)
|
|
@@ -4213,7 +4213,7 @@ var MESApiService = /** @class */ (function () {
|
|
|
4213
4213
|
})
|
|
4214
4214
|
.then(function (response) {
|
|
4215
4215
|
if (response.status === 401) {
|
|
4216
|
-
window.location.href = "".concat(base$
|
|
4216
|
+
window.location.href = "".concat(base$1, "logout?message=Session%20expired&redirectTo=").concat(window.location.href);
|
|
4217
4217
|
}
|
|
4218
4218
|
isError = { ok: response.ok, status: response.status, statusText: response.statusText };
|
|
4219
4219
|
if (!isError.ok)
|
|
@@ -5241,7 +5241,6 @@ function Account() {
|
|
|
5241
5241
|
}
|
|
5242
5242
|
|
|
5243
5243
|
var AuthContext = React__default.createContext({});
|
|
5244
|
-
var base$1 = document.getElementsByTagName('base')[0].getAttribute('href') || '/';
|
|
5245
5244
|
var AuthProvider = function (_a) {
|
|
5246
5245
|
var children = _a.children, authConfig = _a.authConfig;
|
|
5247
5246
|
var useTokenHook = useToken();
|
|
@@ -5256,9 +5255,7 @@ var Authenticated = function (_a) {
|
|
|
5256
5255
|
};
|
|
5257
5256
|
var Unauthenticated = function (_a) {
|
|
5258
5257
|
var authConfig = _a.authConfig;
|
|
5259
|
-
return (React__default.createElement(
|
|
5260
|
-
React__default.createElement(Routes, null,
|
|
5261
|
-
React__default.createElement(Route, { path: '/', element: React__default.createElement(Login, { authConfig: authConfig }) }))));
|
|
5258
|
+
return (React__default.createElement(Login, { authConfig: authConfig }));
|
|
5262
5259
|
};
|
|
5263
5260
|
|
|
5264
5261
|
var LoginWithEmailAndPassword = function () {
|
|
@@ -5458,20 +5455,23 @@ var LoginAsGuest = function () {
|
|
|
5458
5455
|
|
|
5459
5456
|
function Login(_a) {
|
|
5460
5457
|
var authConfig = _a.authConfig;
|
|
5461
|
-
var
|
|
5462
|
-
var
|
|
5463
|
-
var
|
|
5458
|
+
var params = useRef((new URL(document.location)).searchParams);
|
|
5459
|
+
var _b = useState(false), open = _b[0], setOpen = _b[1];
|
|
5460
|
+
var _c = useState(''), message = _c[0], setMessage = _c[1];
|
|
5464
5461
|
var useEmailAndPassword = get$1(authConfig, 'useEmailAndPassword', true);
|
|
5465
5462
|
var useAzureAD = get$1(authConfig, 'useAzureAD', false);
|
|
5466
5463
|
var guestIsEnabled = get$1(authConfig, 'guestIsEnabled', false);
|
|
5467
5464
|
var handleClose = function () {
|
|
5468
5465
|
setOpen(false);
|
|
5469
|
-
params["delete"]('message');
|
|
5470
|
-
|
|
5466
|
+
params.current["delete"]('message');
|
|
5467
|
+
var newUrl = window.location.origin
|
|
5468
|
+
+ window.location.pathname
|
|
5469
|
+
+ '?' + params.current.toString();
|
|
5470
|
+
window.history.replaceState({ path: newUrl }, '', newUrl);
|
|
5471
5471
|
};
|
|
5472
5472
|
useEffect(function () {
|
|
5473
|
-
if (params.has('message')) {
|
|
5474
|
-
setMessage(params.get('message'));
|
|
5473
|
+
if (params.current.has('message')) {
|
|
5474
|
+
setMessage(params.current.get('message'));
|
|
5475
5475
|
setOpen(true);
|
|
5476
5476
|
}
|
|
5477
5477
|
}, [params.toString()]);
|
|
@@ -5489,10 +5489,7 @@ function Login(_a) {
|
|
|
5489
5489
|
useAzureAD && React__default.createElement(LoginWithAzureAD, { config: authConfig.AzureConfig }),
|
|
5490
5490
|
guestIsEnabled && React__default.createElement(LoginAsGuest, null)))))),
|
|
5491
5491
|
React__default.createElement(Snackbar$1, { open: open, autoHideDuration: 6000, onClose: handleClose, message: message })));
|
|
5492
|
-
}
|
|
5493
|
-
Login.propTypes = {
|
|
5494
|
-
setToken: PropTypes.func
|
|
5495
|
-
};
|
|
5492
|
+
}
|
|
5496
5493
|
|
|
5497
5494
|
function Logout() {
|
|
5498
5495
|
var _this = this;
|
|
@@ -5666,8 +5663,7 @@ var Navigation = function () {
|
|
|
5666
5663
|
var css = "body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background-color: #fafbfc !important;\n}\n.container-fluid-main{\n padding-right: 0px !important; \n padding-left: 0px !important;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n\n.mes-primary-color {\n background-color: #479dc4 !important;\n}\n.mes-button-primary{\n background-color: #479dc4 !important;\n border-color: #479dc4 !important;\n}\n\n.mes-selectable-datagrid .MuiDataGrid-row{\n cursor: pointer;\n}\n\n.mes-menu-top .navbar-brand{\n color: #FFFF !important;\n}\n.mes-menu-top .nav-link {\n color: #FFFF !important;\n}\n.mes-menu-top .navbar-toggler {\n color: #FFFF !important;\n}\n.mes-menu-top .navbar-text {\n color: #FFFF !important;\n}\n.mes-footer-login{\n position: absolute;\n bottom: 0;\n width: 100%;\n height: 10em;\n line-height: 60px;\n text-align:center;\n}\n.mes-filter-datepicker{\n padding: unset !important;\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n padding-top: 0.375rem !important;\n padding-bottom: 0.375rem !important;\n padding-left: 0.75rem !important;\n cursor: pointer !important;\n max-width: 120px;\n}\n.mes-filter-datetimepicker{\n max-width: 97px;\n}\n.mes-not-rounded{\n border-radius: unset !important;\n}\n\n.mes-numeric{\n text-align: right;\n}\n.mes-drag-over{\n border: 3px dotted #666;\n background-color: #479dc4 !important;\n}\n.mes-drag-start{\n border: 3px solid #666;\n}\n\n.mes-selectable{\n cursor: pointer !important;\n}\n\n.mes-custom-select{\n width: auto !important;\n padding: 0.375rem 0 0.375rem 0 !important;\n background: unset !important;\n font-family: inherit !important;\n}\n.mes-custom-select .MuiSelect-select{\n padding-left: 14px;\n}\n\n.mes-custom-select::before{\n border-bottom: unset !important;\n}\n.mes-custom-select::after{\n border-bottom: unset !important;\n}\n.mes-no-border{\n border: unset;\n}\n.mes-no-border:focus-visible {\n outline: unset;\n}\n.mes-div-submenu{\n border-right: 1px solid #cfdbe2; \n}\n.mes-submenu a{\n width: 100% !important;\n /* color: rgba(0, 0, 0, 0.87); */\n color: #479dc4\n}\n.mes-submenu .Mui-selected{\n border-right: 3px solid #479dc4; \n}\n.mes-menu-group{\n font-size: 20px;\n line-height: 1.1;\n color: #929292; \n font-weight: normal; \n}\n\n/********************MUI DATAGRID*****************************/\n.Mui-selected{\n font-weight: bolder !important;\n opacity: 1 !important;\n}\n\n.mes-upload-control{\n\n}\n.mes-upload-control .file-box{\n /* border : 1px solid black; */\n height : 100px;\n position: relative; \n}\n.mes-upload-control .file-detail{\n position: absolute;\n left: 0px;\n top: 0px; \n z-index: 1;\n height: 100%;\n width: 100%;\n}\n\n.mes-upload-control input[type=file]{\n left: 0px;\n top: 0px;\n opacity: 0;\n z-index: 10000;\n height: 100%;\n cursor: pointer;\n}\n.mes-upload-control table{\n width: 100%;\n}\n.mes-upload-control td{\n font-size: 0.8rem !important;\n max-width:0;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;\n}\n\n\n.input-group-text{\n background-color: #ced2cc !important;\n /* border: 1px solid #ced4da !important; */\n /* color: #000000 !important; */\n}\n\n\n\n\n.content-wrapper {\n padding: 15px;\n width: 100%;\n border-top: 1px solid rgba(0, 0, 0, 0.15);\n margin-top: -1px;\n}\n.content-wrapper > .unwrap {\n margin: -15px;\n}\n@media only screen and (min-width: 768px) {\n .content-wrapper > .unwrap {\n margin: -20px;\n }\n}\n.content-wrapper > h3,\n.content-wrapper > .content-heading {\n font-size: 24px;\n line-height: 1.1;\n color: #929292;\n margin: -15px;\n margin-bottom: 20px;\n padding: 15px;\n font-weight: normal;\n background-color: #fafbfc;\n border-bottom: 1px solid #cfdbe2;\n}\n.content-wrapper > h3 > small,\n.content-wrapper > .content-heading > small {\n display: block;\n font-size: 12px;\n color: #909fa7;\n}\n.content-wrapper > button,\n.content-wrapper > .btn {\n margin: 10px 10px 0 0;\n}\n.content-wrapper .container,\n.content-wrapper .container-fluid {\n padding-left: 0;\n padding-right: 0;\n}\n@media only screen and (min-width: 768px) {\n .content-wrapper {\n padding: 20px;\n }\n .content-wrapper > h3,\n .content-wrapper > .content-heading {\n margin: -20px;\n margin-bottom: 5px;\n padding: 15px;\n }\n .content-wrapper > button,\n .content-wrapper > .btn {\n margin: 0;\n }\n}\n\n @media print {\n .sidebar,\n .topnavbar,\n .offsidebar,\n .btn {\n display: none !important;\n width: 0 !important;\n height: 0 !important;\n }\n .wrapper,\n .wrapper > section,\n .content-wrapper {\n margin: 0 !important;\n /* remove margin used for sidebar and expand the content */\n padding: 0 !important;\n width: 100% !important;\n }\n .content-wrapper {\n overflow: hidden !important;\n }\n }\n ";
|
|
5667
5664
|
n(css,{});
|
|
5668
5665
|
|
|
5669
|
-
var
|
|
5670
|
-
var base = ((_a = document.getElementsByTagName('base')[0].getAttribute('href')) === null || _a === void 0 ? void 0 : _a.replace(/\/$/, "")) || '/';
|
|
5666
|
+
var base = document.getElementsByTagName('base')[0].getAttribute('href') || '/';
|
|
5671
5667
|
function MESFMain(props) {
|
|
5672
5668
|
return (React__default.createElement(AuthProvider, { authConfig: props.authentication },
|
|
5673
5669
|
React__default.createElement(RouterContext.Provider, { value: props.routes },
|
|
@@ -5680,4 +5676,3 @@ function MESFMain(props) {
|
|
|
5680
5676
|
}
|
|
5681
5677
|
|
|
5682
5678
|
export { Account, AuthContext, AuthProvider, BarChartControl, ChangePassword, CheckBoxControl, Configuration$1 as Configuration, CurrencyFormatter, DataGridControl, DateControl, DateFormatter, DateTimeControl, DateTimeFormatter, FetchError, FilterPanel, GenericPanel, GenericTable, GetCrewColor, GetShiftColor, HorizontalTextControl, IntegerFormatter, Login, Logout, LongFilterPanel, MESApiService, MESFMain, MESSAGE_API, MESSAGE_ERRORS, MasterDetailPanel, ModalTreeFilterControl, MultipleSelectorControl, NumberFormatter, NumericTextControl, SimpleInputSearchControl, SimplePasswordControl, SimpleSelectorControl, SimpleTextAreaControl, SimpleTextControl, SimpleTimeControl, TimeControl, TimeFormatter, TreePickerControl, USER_LABELS, UploadFileControl, formatNumber, getCrewStyle, getShiftStyle, useToken };
|
|
5683
|
-
//# sourceMappingURL=index.esm.js.map
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexteel/mesf-core",
|
|
3
|
-
"version": "3.2.
|
|
4
|
-
"author": "
|
|
3
|
+
"version": "3.2.2",
|
|
4
|
+
"author": "Dexteel Team",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"prepublish": "rimraf -rf ./dist && npm run build",
|
|
9
9
|
"build": "rimraf -rf ./dist && rollup -c",
|
|
10
|
-
"watch": "rollup -wc",
|
|
11
|
-
"start": "rollup -wc"
|
|
10
|
+
"watch": "cross-env rollup -wc",
|
|
11
|
+
"start": "cross-env rollup -wc"
|
|
12
12
|
},
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"devDependencies": {
|
|
@@ -73,6 +73,8 @@
|
|
|
73
73
|
"react-dom": "^17.0.2",
|
|
74
74
|
"react-router-dom": "^6.2.1",
|
|
75
75
|
"react-spring": "^9.4.3",
|
|
76
|
+
"string-to-color": "^2.2.2",
|
|
77
|
+
"use-complex-state": "^1.1.0",
|
|
76
78
|
"rimraf": "^3.0.2"
|
|
77
79
|
},
|
|
78
80
|
"browserslist": {
|