@dexteel/mesf-core 5.7.1 → 5.8.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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [5.8.0](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v5.7.1...@dexteel/mesf-core-v5.8.0) (2025-08-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **Shift navigator control:** Add 'withoutPaper' prop to control the use of Paper in the ShiftDayNavigatorControl component ([#429](https://github.com/dexteel/mesf-core-frontend/issues/429)) ([68c01b0](https://github.com/dexteel/mesf-core-frontend/commit/68c01b0712c3cec65d7673842a67af49735fb483))
|
|
9
|
+
|
|
10
|
+
## [5.7.1] - 2025-08-25
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
1
14
|
# Changelog
|
|
2
15
|
|
|
3
16
|
## [5.7.1](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v5.7.0...@dexteel/mesf-core-v5.7.1) (2025-08-25)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type ShiftNavigatorDirection = "Previous" | "Next" | "Last";
|
|
3
|
-
export declare const ShiftDayNavigatorControl: (
|
|
3
|
+
export declare const ShiftDayNavigatorControl: ({ useRouter, onShiftChange, preventInit, withPaper, }: {
|
|
4
4
|
useRouter?: boolean;
|
|
5
5
|
onShiftChange?: (shiftId: number) => void;
|
|
6
6
|
preventInit?: boolean;
|
|
7
|
+
withPaper?: boolean;
|
|
7
8
|
}) => React.JSX.Element;
|
package/dist/index.esm.js
CHANGED
|
@@ -1394,11 +1394,12 @@ var ShiftNavigatorProvider = function (_a) {
|
|
|
1394
1394
|
return (React__default.createElement(ShiftNavigatorContext.Provider, { value: shiftNavigatorManager }, children));
|
|
1395
1395
|
};
|
|
1396
1396
|
|
|
1397
|
-
var ShiftDayNavigatorControl = function (
|
|
1398
|
-
var
|
|
1399
|
-
var
|
|
1400
|
-
var
|
|
1401
|
-
var
|
|
1397
|
+
var ShiftDayNavigatorControl = function (_a) {
|
|
1398
|
+
var _b;
|
|
1399
|
+
var useRouter = _a.useRouter, onShiftChange = _a.onShiftChange, preventInit = _a.preventInit, _c = _a.withPaper, withPaper = _c === void 0 ? true : _c;
|
|
1400
|
+
var _d = useShiftNavigator(), shiftInfo = _d.shiftInfo, initShiftNavigator = _d.initShiftNavigator, moveShift = _d.moveShift, getShiftDataFromAPI = _d.getShiftDataFromAPI;
|
|
1401
|
+
var _e = useState(shiftInfo), shiftInfoCopy = _e[0], setShiftInfoCopy = _e[1];
|
|
1402
|
+
var _f = useState(""); _f[0]; var setError = _f[1];
|
|
1402
1403
|
var shiftId = useParams().shiftId;
|
|
1403
1404
|
var firstRender = useRef(true);
|
|
1404
1405
|
var updateHistory = function (shiftId) {
|
|
@@ -1406,8 +1407,8 @@ var ShiftDayNavigatorControl = function (props) {
|
|
|
1406
1407
|
window.history.replaceState(null, "", "/".concat(paths[1]) + "/".concat(shiftId));
|
|
1407
1408
|
};
|
|
1408
1409
|
if (shiftInfo !== null && shiftInfo.CurrentShiftId) {
|
|
1409
|
-
if (
|
|
1410
|
-
updateHistory((
|
|
1410
|
+
if (useRouter) {
|
|
1411
|
+
updateHistory((_b = shiftInfo === null || shiftInfo === void 0 ? void 0 : shiftInfo.CurrentShiftId) === null || _b === void 0 ? void 0 : _b.toString());
|
|
1411
1412
|
}
|
|
1412
1413
|
}
|
|
1413
1414
|
useEffect(function () {
|
|
@@ -1454,62 +1455,62 @@ var ShiftDayNavigatorControl = function (props) {
|
|
|
1454
1455
|
useEffect(function () {
|
|
1455
1456
|
if (firstRender.current) {
|
|
1456
1457
|
firstRender.current = false;
|
|
1457
|
-
if (
|
|
1458
|
+
if (preventInit) {
|
|
1458
1459
|
return;
|
|
1459
1460
|
}
|
|
1460
|
-
if (
|
|
1461
|
+
if (useRouter && shiftId) {
|
|
1461
1462
|
getShiftDataFromAPI(null, Number(shiftId)).then(function () {
|
|
1462
|
-
|
|
1463
|
+
onShiftChange && onShiftChange(Number(shiftId));
|
|
1463
1464
|
});
|
|
1464
1465
|
}
|
|
1465
1466
|
else {
|
|
1466
1467
|
initShiftNavigator().then(function () {
|
|
1467
|
-
|
|
1468
|
+
onShiftChange && onShiftChange(Number(shiftId));
|
|
1468
1469
|
});
|
|
1469
1470
|
}
|
|
1470
1471
|
}
|
|
1471
1472
|
}, []);
|
|
1472
|
-
|
|
1473
|
-
React__default.createElement(Grid, { item: true
|
|
1474
|
-
React__default.createElement(
|
|
1475
|
-
React__default.createElement(
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
React__default.createElement(
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
width: "110px",
|
|
1495
|
-
},
|
|
1473
|
+
var gridContent = (React__default.createElement(Grid, { item: true, container: true, style: { minWidth: "0%", margin: "1rem" }, direction: "row", justifyContent: "flex-start", alignItems: "center", spacing: 1 },
|
|
1474
|
+
React__default.createElement(Grid, { item: true },
|
|
1475
|
+
React__default.createElement(Tooltip, { title: "Previous Shift" },
|
|
1476
|
+
React__default.createElement(IconButton$1, { "aria-label": "Previous Shift", color: "primary", disabled: !(shiftInfo === null || shiftInfo === void 0 ? void 0 : shiftInfo.PreviousShiftId), onClick: function () {
|
|
1477
|
+
moveShift("Previous").then(function () { });
|
|
1478
|
+
}, size: "small" },
|
|
1479
|
+
React__default.createElement(ArrowBackRounded, null)))),
|
|
1480
|
+
React__default.createElement(Grid, { item: true },
|
|
1481
|
+
React__default.createElement(DatePicker, { label: "Current Date", timezone: "UTC", format: "MM/DD/YYYY", maxDate: moment$2(), closeOnSelect: true, formatDensity: "dense", value: moment$2(shiftInfo === null || shiftInfo === void 0 ? void 0 : shiftInfo.CurrentProductionDate), onChange: function (date) {
|
|
1482
|
+
if (date) {
|
|
1483
|
+
getShiftDataFromAPI(date.toDate(), 0).then(function () { });
|
|
1484
|
+
}
|
|
1485
|
+
}, slots: {
|
|
1486
|
+
textField: TextField,
|
|
1487
|
+
}, slotProps: {
|
|
1488
|
+
textField: {
|
|
1489
|
+
variant: "outlined",
|
|
1490
|
+
size: "small",
|
|
1491
|
+
inputProps: {
|
|
1492
|
+
style: {
|
|
1493
|
+
textAlign: "center",
|
|
1494
|
+
width: "110px",
|
|
1496
1495
|
},
|
|
1497
1496
|
},
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
React__default.createElement(
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1497
|
+
},
|
|
1498
|
+
} })),
|
|
1499
|
+
React__default.createElement(Grid, { item: true, style: { maxWidth: "100px" } },
|
|
1500
|
+
React__default.createElement(TextField, { label: "Shift - Crew", value: "".concat((shiftInfo === null || shiftInfo === void 0 ? void 0 : shiftInfo.CurrentShift) || "", " - ").concat((shiftInfo === null || shiftInfo === void 0 ? void 0 : shiftInfo.CurrentCrew) || ""), placeholder: "Shift", "aria-readonly": true, variant: "outlined", size: "small" })),
|
|
1501
|
+
React__default.createElement(Grid, { item: true },
|
|
1502
|
+
React__default.createElement(Tooltip, { title: "Next Shift" },
|
|
1503
|
+
React__default.createElement(IconButton$1, { "aria-label": "next", color: "primary", disabled: !(shiftInfoCopy === null || shiftInfoCopy === void 0 ? void 0 : shiftInfoCopy.NextShiftId), onClick: function () {
|
|
1504
|
+
moveShift("Next").then(function () { });
|
|
1505
|
+
}, size: "small" },
|
|
1506
|
+
React__default.createElement(ArrowForwardRounded, null)))),
|
|
1507
|
+
React__default.createElement(Grid, { item: true },
|
|
1508
|
+
React__default.createElement(Tooltip, { title: "Last Shift" },
|
|
1509
|
+
React__default.createElement(IconButton$1, { "aria-label": "delete", color: "primary", disabled: !(shiftInfoCopy === null || shiftInfoCopy === void 0 ? void 0 : shiftInfoCopy.LastShiftId) || !(shiftInfoCopy === null || shiftInfoCopy === void 0 ? void 0 : shiftInfoCopy.NextShiftId), onClick: function () {
|
|
1510
|
+
moveShift("Last").then(function () { });
|
|
1511
|
+
}, size: "small" },
|
|
1512
|
+
React__default.createElement(SkipNext, null))))));
|
|
1513
|
+
return withPaper !== false ? React__default.createElement(Paper, null, gridContent) : gridContent;
|
|
1513
1514
|
};
|
|
1514
1515
|
|
|
1515
1516
|
var getShiftsRangeByParameters = function (period_1) {
|