@dexteel/mesf-core 7.10.0 → 7.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +19 -0
- package/dist/account/login.d.ts +1 -1
- package/dist/account/models/login.models.d.ts +1 -0
- package/dist/index.esm.js +117 -15
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [7.11.0](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v7.10.1...@dexteel/mesf-core-v7.11.0) (2026-01-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **auth:** Enhance login flow with error handling and redirect support ([3015688](https://github.com/dexteel/mesf-core-frontend/commit/301568807376ed71de3198fb34c3702058617c2d))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **button-with-loading:** Difference isLoading and disabled. ([62642aa](https://github.com/dexteel/mesf-core-frontend/commit/62642aa289676460011ff895f1fbd8a222440254))
|
|
14
|
+
|
|
15
|
+
## [7.10.1](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v7.10.0...@dexteel/mesf-core-v7.10.1) (2025-12-30)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **trendings-v2:** anchor zoom to mouse cursor position ([d3b959a](https://github.com/dexteel/mesf-core-frontend/commit/d3b959ae547ef6c0db0faa3e5f35c706844617e7))
|
|
21
|
+
|
|
3
22
|
## [7.10.0](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v7.9.0...@dexteel/mesf-core-v7.10.0) (2025-12-29)
|
|
4
23
|
|
|
5
24
|
|
package/dist/account/login.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -7271,26 +7271,44 @@ var LoginWithAzureAD = function (_a) {
|
|
|
7271
7271
|
};
|
|
7272
7272
|
|
|
7273
7273
|
function Login(_a) {
|
|
7274
|
-
var authConfig = _a.authConfig;
|
|
7274
|
+
var authConfig = _a.authConfig, initialError = _a.initialError;
|
|
7275
7275
|
var params = useRef(new URL(document.location).searchParams);
|
|
7276
7276
|
var _b = useState(false), open = _b[0], setOpen = _b[1];
|
|
7277
7277
|
var _c = useState(""), message = _c[0], setMessage = _c[1];
|
|
7278
|
+
var _d = useState("info"), severity = _d[0], setSeverity = _d[1];
|
|
7278
7279
|
var useEmailAndPassword = get(authConfig, "useEmailAndPassword", true);
|
|
7279
7280
|
var useAzureAD = get(authConfig, "useAzureAD", false);
|
|
7280
7281
|
var useWindowsAuth = get(authConfig, "useWindowsAuth", false);
|
|
7281
7282
|
var guestIsEnabled = get(authConfig, "guestIsEnabled", false);
|
|
7283
|
+
var getBase = function () { var _a; return ((_a = document.getElementsByTagName("base")[0]) === null || _a === void 0 ? void 0 : _a.getAttribute("href")) || "/"; };
|
|
7282
7284
|
var handleClose = function () {
|
|
7283
7285
|
setOpen(false);
|
|
7284
|
-
params
|
|
7285
|
-
var
|
|
7286
|
+
// Read current URL params (not the ref) to preserve redirectTo
|
|
7287
|
+
var currentParams = new URL(document.location).searchParams;
|
|
7288
|
+
currentParams.delete("message");
|
|
7289
|
+
currentParams.delete("error");
|
|
7290
|
+
var base = getBase();
|
|
7291
|
+
var queryString = currentParams.toString();
|
|
7292
|
+
var newUrl = "".concat(window.location.origin).concat(base).concat(queryString ? "?".concat(queryString) : "");
|
|
7286
7293
|
window.history.replaceState({ path: newUrl }, "", newUrl);
|
|
7287
7294
|
};
|
|
7288
7295
|
useEffect(function () {
|
|
7289
|
-
if (
|
|
7296
|
+
if (initialError) {
|
|
7297
|
+
setMessage(initialError);
|
|
7298
|
+
setSeverity("error");
|
|
7299
|
+
setOpen(true);
|
|
7300
|
+
}
|
|
7301
|
+
else if (params.current.has("error")) {
|
|
7302
|
+
setMessage(params.current.get("error"));
|
|
7303
|
+
setSeverity("error");
|
|
7304
|
+
setOpen(true);
|
|
7305
|
+
}
|
|
7306
|
+
else if (params.current.has("message")) {
|
|
7290
7307
|
setMessage(params.current.get("message"));
|
|
7308
|
+
setSeverity("info");
|
|
7291
7309
|
setOpen(true);
|
|
7292
7310
|
}
|
|
7293
|
-
}, [
|
|
7311
|
+
}, [initialError]);
|
|
7294
7312
|
return (React__default.createElement(Box, { sx: {
|
|
7295
7313
|
minHeight: "100vh",
|
|
7296
7314
|
backgroundImage: "linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)",
|
|
@@ -7384,9 +7402,10 @@ function Login(_a) {
|
|
|
7384
7402
|
useAzureAD && (React__default.createElement(LoginWithAzureAD, { config: authConfig.AzureConfig })),
|
|
7385
7403
|
guestIsEnabled && React__default.createElement(LoginAsGuest, null))))))))),
|
|
7386
7404
|
React__default.createElement(Snackbar, { open: open, autoHideDuration: 6000, onClose: handleClose, anchorOrigin: { vertical: "bottom", horizontal: "center" } },
|
|
7387
|
-
React__default.createElement(Alert$4, { onClose: handleClose, severity:
|
|
7405
|
+
React__default.createElement(Alert$4, { onClose: handleClose, severity: severity, variant: "filled" }, message))));
|
|
7388
7406
|
}
|
|
7389
7407
|
|
|
7408
|
+
var getBase = function () { var _a; return ((_a = document.getElementsByTagName("base")[0]) === null || _a === void 0 ? void 0 : _a.getAttribute("href")) || "/"; };
|
|
7390
7409
|
var AuthProvider = function (_a) {
|
|
7391
7410
|
var children = _a.children, authConfig = _a.authConfig;
|
|
7392
7411
|
var useTokenHook = useToken();
|
|
@@ -7397,18 +7416,42 @@ var AuthProvider = function (_a) {
|
|
|
7397
7416
|
};
|
|
7398
7417
|
var Authenticated = function (_a) {
|
|
7399
7418
|
var children = _a.children;
|
|
7419
|
+
var redirectTo = new URL(document.location).searchParams.get("redirectTo");
|
|
7420
|
+
useEffect(function () {
|
|
7421
|
+
if (redirectTo) {
|
|
7422
|
+
window.location.href = decodeURIComponent(redirectTo);
|
|
7423
|
+
}
|
|
7424
|
+
}, []);
|
|
7425
|
+
if (redirectTo) {
|
|
7426
|
+
return null;
|
|
7427
|
+
}
|
|
7400
7428
|
return React__default.createElement(React__default.Fragment, null, children);
|
|
7401
7429
|
};
|
|
7402
7430
|
var Unauthenticated = function (_a) {
|
|
7403
7431
|
var authConfig = _a.authConfig;
|
|
7404
7432
|
var clearUserData = useContext(AuthContext).clearUserData;
|
|
7405
|
-
var
|
|
7433
|
+
var currentUrl = new URL(document.location);
|
|
7434
|
+
var base = getBase();
|
|
7435
|
+
var basePath = base.endsWith("/") ? base.slice(0, -1) : base;
|
|
7436
|
+
var isRootPath = currentUrl.pathname === "/" ||
|
|
7437
|
+
currentUrl.pathname === base ||
|
|
7438
|
+
currentUrl.pathname === basePath;
|
|
7439
|
+
var hasRedirectTo = currentUrl.searchParams.has("redirectTo");
|
|
7440
|
+
var shouldShowError = !isRootPath && !hasRedirectTo;
|
|
7406
7441
|
useEffect(function () {
|
|
7407
7442
|
clearUserData();
|
|
7408
|
-
|
|
7409
|
-
|
|
7443
|
+
if (shouldShowError) {
|
|
7444
|
+
var fullPath = currentUrl.pathname + currentUrl.search;
|
|
7445
|
+
var newParams = new URLSearchParams();
|
|
7446
|
+
newParams.set("redirectTo", fullPath);
|
|
7447
|
+
newParams.set("error", "Session expired. Please log in to continue");
|
|
7448
|
+
var newUrl = "".concat(window.location.origin).concat(base, "?").concat(newParams.toString());
|
|
7449
|
+
window.history.replaceState({ path: newUrl }, "", newUrl);
|
|
7450
|
+
}
|
|
7410
7451
|
}, []);
|
|
7411
|
-
return React__default.createElement(Login, { authConfig: authConfig
|
|
7452
|
+
return (React__default.createElement(Login, { authConfig: authConfig, initialError: shouldShowError
|
|
7453
|
+
? "Session expired. Please log in to continue"
|
|
7454
|
+
: undefined }));
|
|
7412
7455
|
};
|
|
7413
7456
|
|
|
7414
7457
|
function Logout() {
|
|
@@ -7506,7 +7549,7 @@ var TimeAndUserMenu = function () {
|
|
|
7506
7549
|
|
|
7507
7550
|
var ButtonWithLoading = function (_a) {
|
|
7508
7551
|
var children = _a.children, isLoading = _a.isLoading, props = __rest(_a, ["children", "isLoading"]);
|
|
7509
|
-
return (React__default.createElement(Button, __assign({}, props, { disabled: isLoading }),
|
|
7552
|
+
return (React__default.createElement(Button, __assign({}, props, { disabled: isLoading || props.disabled }),
|
|
7510
7553
|
isLoading && React__default.createElement(CircularProgress, { size: "1rem" }),
|
|
7511
7554
|
children));
|
|
7512
7555
|
};
|
|
@@ -15908,7 +15951,7 @@ var TrendingChartV2 = function (_a) {
|
|
|
15908
15951
|
}); }), true);
|
|
15909
15952
|
})(),
|
|
15910
15953
|
dataZoom: __spreadArray([
|
|
15911
|
-
__assign({ type: "inside", xAxisIndex: useSeparateGrids ? [0, 1] : [0], zoomOnMouseWheel:
|
|
15954
|
+
__assign({ type: "inside", xAxisIndex: useSeparateGrids ? [0, 1] : [0], zoomOnMouseWheel: false, moveOnMouseMove: true, moveOnMouseWheel: false, preventDefaultMouseMove: false }, (zoomState ? { start: zoomState.start, end: zoomState.end } : {}))
|
|
15912
15955
|
], ([
|
|
15913
15956
|
__assign({ type: "slider", xAxisIndex: useSeparateGrids ? [0, 1] : [0], bottom: 3, height: 19, handleSize: "80%", showDetail: true, filterMode: "none" }, (zoomState
|
|
15914
15957
|
? { start: zoomState.start, end: zoomState.end }
|
|
@@ -16164,8 +16207,8 @@ var TrendingChartV2 = function (_a) {
|
|
|
16164
16207
|
return;
|
|
16165
16208
|
var handleKeyDown = function (e) {
|
|
16166
16209
|
var range = timeScopeEnd.getTime() - timeScopeStart.getTime();
|
|
16167
|
-
var smallStep = range * 0.01;
|
|
16168
|
-
var largeStep = range * 0.05;
|
|
16210
|
+
var smallStep = range * 0.01;
|
|
16211
|
+
var largeStep = range * 0.05;
|
|
16169
16212
|
var step = e.shiftKey ? largeStep : smallStep;
|
|
16170
16213
|
switch (e.key) {
|
|
16171
16214
|
case "ArrowLeft":
|
|
@@ -16192,7 +16235,6 @@ var TrendingChartV2 = function (_a) {
|
|
|
16192
16235
|
break;
|
|
16193
16236
|
case "Tab":
|
|
16194
16237
|
e.preventDefault();
|
|
16195
|
-
// Switch between cursors
|
|
16196
16238
|
setSelectedCursor(selectedCursor === "cursor1" ? "cursor2" : "cursor1");
|
|
16197
16239
|
break;
|
|
16198
16240
|
}
|
|
@@ -16209,6 +16251,66 @@ var TrendingChartV2 = function (_a) {
|
|
|
16209
16251
|
updateCursor2Time,
|
|
16210
16252
|
setSelectedCursor,
|
|
16211
16253
|
]);
|
|
16254
|
+
// Custom wheel zoom handler to correctly anchor zoom to mouse cursor position
|
|
16255
|
+
// ECharts' built-in zoom has a bug with multiple grids - it always uses the first grid's coordinates
|
|
16256
|
+
useEffect(function () {
|
|
16257
|
+
var _a;
|
|
16258
|
+
var echartsInstance = (_a = chartRef.current) === null || _a === void 0 ? void 0 : _a.getEchartsInstance();
|
|
16259
|
+
if (!echartsInstance || !chartArea)
|
|
16260
|
+
return;
|
|
16261
|
+
var zr = echartsInstance.getZr();
|
|
16262
|
+
if (!zr)
|
|
16263
|
+
return;
|
|
16264
|
+
var handleWheel = function (e) {
|
|
16265
|
+
var _a, _b;
|
|
16266
|
+
var wheelEvent = e.event;
|
|
16267
|
+
var mouseX = e.offsetX;
|
|
16268
|
+
if (mouseX < chartArea.left || mouseX > chartArea.right)
|
|
16269
|
+
return;
|
|
16270
|
+
wheelEvent.preventDefault();
|
|
16271
|
+
wheelEvent.stopPropagation();
|
|
16272
|
+
var option = echartsInstance.getOption();
|
|
16273
|
+
var dataZoomArray = option.dataZoom;
|
|
16274
|
+
if (!dataZoomArray || dataZoomArray.length === 0)
|
|
16275
|
+
return;
|
|
16276
|
+
var currentStart = (_a = dataZoomArray[0].start) !== null && _a !== void 0 ? _a : 0;
|
|
16277
|
+
var currentEnd = (_b = dataZoomArray[0].end) !== null && _b !== void 0 ? _b : 100;
|
|
16278
|
+
var fullRangeStart = timeScopeStart.getTime();
|
|
16279
|
+
var fullRangeEnd = timeScopeEnd.getTime();
|
|
16280
|
+
var fullRange = fullRangeEnd - fullRangeStart;
|
|
16281
|
+
var visibleStart = fullRangeStart + (fullRange * currentStart) / 100;
|
|
16282
|
+
var visibleEnd = fullRangeStart + (fullRange * currentEnd) / 100;
|
|
16283
|
+
var visibleRange = visibleEnd - visibleStart;
|
|
16284
|
+
var chartWidth = chartArea.right - chartArea.left;
|
|
16285
|
+
var mouseProgress = (mouseX - chartArea.left) / chartWidth;
|
|
16286
|
+
var mouseTimestamp = visibleStart + visibleRange * mouseProgress;
|
|
16287
|
+
var zoomFactor = wheelEvent.deltaY > 0 ? 1.2 : 1 / 1.2;
|
|
16288
|
+
var newVisibleRange = visibleRange * zoomFactor;
|
|
16289
|
+
var newVisibleStart = mouseTimestamp - newVisibleRange * mouseProgress;
|
|
16290
|
+
var newVisibleEnd = mouseTimestamp + newVisibleRange * (1 - mouseProgress);
|
|
16291
|
+
var newStart = ((newVisibleStart - fullRangeStart) / fullRange) * 100;
|
|
16292
|
+
var newEnd = ((newVisibleEnd - fullRangeStart) / fullRange) * 100;
|
|
16293
|
+
if (newStart < 0) {
|
|
16294
|
+
newEnd -= newStart;
|
|
16295
|
+
newStart = 0;
|
|
16296
|
+
}
|
|
16297
|
+
if (newEnd > 100) {
|
|
16298
|
+
newStart -= newEnd - 100;
|
|
16299
|
+
newEnd = 100;
|
|
16300
|
+
}
|
|
16301
|
+
newStart = Math.max(0, newStart);
|
|
16302
|
+
newEnd = Math.min(100, newEnd);
|
|
16303
|
+
echartsInstance.dispatchAction({
|
|
16304
|
+
type: "dataZoom",
|
|
16305
|
+
start: newStart,
|
|
16306
|
+
end: newEnd,
|
|
16307
|
+
});
|
|
16308
|
+
};
|
|
16309
|
+
zr.on("mousewheel", handleWheel);
|
|
16310
|
+
return function () {
|
|
16311
|
+
zr.off("mousewheel", handleWheel);
|
|
16312
|
+
};
|
|
16313
|
+
}, [chartArea, timeScopeStart, timeScopeEnd, chartInstance]);
|
|
16212
16314
|
return (React__default.createElement(Paper, { sx: { height: "100%", p: 1, position: "relative" } },
|
|
16213
16315
|
isLoading && (React__default.createElement("div", { style: {
|
|
16214
16316
|
position: "absolute",
|