@dexteel/mesf-core 4.18.1 → 4.20.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 +26 -0
- package/dist/controls/filters/TreePickerControl.d.ts +11 -0
- package/dist/controls/filters/TreePickerControlV2.d.ts +13 -0
- package/dist/controls/filters/dialogFilter.d.ts +1 -1
- package/dist/controls/filters/filters.d.ts +2 -9
- package/dist/controls/shift-navigator/hook/useShiftNavigator.d.ts +6 -6
- package/dist/index.esm.js +123 -35
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [4.20.0](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v4.19.0...@dexteel/mesf-core-v4.20.0) (2024-09-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **Shift Navigator:** Return shift in methods of hook ([52aece5](https://github.com/dexteel/mesf-core-frontend/commit/52aece5e9c9ad67e7cdf078792aa1024af1861a4))
|
|
9
|
+
|
|
10
|
+
## [4.19.0] - 2024-08-12
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# Changelog
|
|
15
|
+
|
|
16
|
+
## [4.19.0](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v4.18.1...@dexteel/mesf-core-v4.19.0) (2024-08-12)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **TreePickerControlV2:** Implement TreePickerControl with value-OnSelect paradigm. ([8f488a3](https://github.com/dexteel/mesf-core-frontend/commit/8f488a3be4ec8e7edcc8f6b0e8fd11610fd57513))
|
|
22
|
+
|
|
23
|
+
## [4.18.1] - 2024-08-01
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
1
27
|
# Changelog
|
|
2
28
|
|
|
3
29
|
## [4.18.1](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v4.18.0...@dexteel/mesf-core-v4.18.1) (2024-08-01)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type TreePickerControlProps = {
|
|
3
|
+
onSelect: (value: number, description: string, findNode: any, showPath?: boolean, listAssetDrawings?: number[], multipleSelectNodes?: boolean, onHide?: (showAssetTree?: boolean) => void, showAssetTree?: boolean) => void;
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
setListAssetDrawings?: Function;
|
|
6
|
+
onSuccess?: (success: boolean) => void;
|
|
7
|
+
showClearButton?: boolean;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
export declare const TreePickerControl: (props: TreePickerControlProps) => React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TreeNode } from "./dialogFilter";
|
|
3
|
+
type TreePickerControlProps = {
|
|
4
|
+
onSelect: (value: number, description: string, findNode: any, showPath?: boolean, listAssetDrawings?: number[], multipleSelectNodes?: boolean, onHide?: (showAssetTree?: boolean) => void, showAssetTree?: boolean) => void;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
setListAssetDrawings?: Function;
|
|
7
|
+
onSuccess?: (success: boolean) => void;
|
|
8
|
+
showClearButton?: boolean;
|
|
9
|
+
dataSource: TreeNode;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
export declare const TreePickerControlV2: (props: TreePickerControlProps) => React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import React, { Component } from "react";
|
|
2
|
-
type TreePickerControlProps = {
|
|
3
|
-
onSelect: (value: string, description: string, findNode: any, showPath?: boolean, listAssetDrawings?: number[], multipleSelectNodes?: boolean, onHide?: (showAssetTree?: boolean) => void, showAssetTree?: boolean) => void;
|
|
4
|
-
isLoading?: boolean;
|
|
5
|
-
setListAssetDrawings?: Function;
|
|
6
|
-
onSuccess?: (success: boolean) => void;
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
};
|
|
9
|
-
export declare const TreePickerControl: (props: TreePickerControlProps) => React.JSX.Element;
|
|
10
2
|
export declare class SimpleTextControl extends Component<any> {
|
|
11
3
|
render(): React.JSX.Element;
|
|
12
4
|
}
|
|
@@ -45,4 +37,5 @@ export declare function SimpleSelectorControl({ title, dataSource, selectedValue
|
|
|
45
37
|
export declare const MultipleSelectorControl: (props: any) => React.JSX.Element;
|
|
46
38
|
export declare const CheckBoxControl: (props: any) => React.JSX.Element;
|
|
47
39
|
export declare const UploadFileControl: (props: any) => React.JSX.Element;
|
|
48
|
-
export
|
|
40
|
+
export * from "./TreePickerControl";
|
|
41
|
+
export * from "./TreePickerControlV2";
|
|
@@ -2,13 +2,13 @@ import { ShiftNavigatorDirection } from "../component/shift-navigator.control";
|
|
|
2
2
|
import { ShiftInfo } from "../models/shift-navigator.model";
|
|
3
3
|
export declare const useShiftNavigatorManager: () => {
|
|
4
4
|
shiftInfo: ShiftInfo | null;
|
|
5
|
-
moveShift: (direction: ShiftNavigatorDirection) => Promise<void>;
|
|
6
|
-
getShiftDataFromAPI: (productionDate: Date | null, shiftId: number) => Promise<void>;
|
|
7
|
-
initShiftNavigator: () => Promise<void>;
|
|
5
|
+
moveShift: (direction: ShiftNavigatorDirection) => Promise<ShiftInfo | void>;
|
|
6
|
+
getShiftDataFromAPI: (productionDate: Date | null, shiftId: number) => Promise<ShiftInfo | void>;
|
|
7
|
+
initShiftNavigator: () => Promise<ShiftInfo | void>;
|
|
8
8
|
};
|
|
9
9
|
export type ShiftNavigatorManagerResult = {
|
|
10
10
|
shiftInfo: ShiftInfo | null;
|
|
11
|
-
moveShift: (direction: ShiftNavigatorDirection) => Promise<void>;
|
|
12
|
-
getShiftDataFromAPI: (productionDate: Date | null, shiftId: number) => Promise<void>;
|
|
13
|
-
initShiftNavigator: () => Promise<void>;
|
|
11
|
+
moveShift: (direction: ShiftNavigatorDirection) => Promise<ShiftInfo | void>;
|
|
12
|
+
getShiftDataFromAPI: (productionDate: Date | null, shiftId: number) => Promise<ShiftInfo | void>;
|
|
13
|
+
initShiftNavigator: () => Promise<ShiftInfo | void>;
|
|
14
14
|
};
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { LicenseManager } from 'ag-grid-enterprise';
|
|
2
|
-
import { DialogTitle as DialogTitle$1, DialogContent as DialogContent$1, DialogActions as DialogActions$1, Grid, Button, withStyles as withStyles$1, alpha, makeStyles, Dialog as Dialog$1, SvgIcon, Collapse, Typography as Typography$1, Checkbox, TextField, MenuItem, Select, Card, CardContent, CardActions, Snackbar, CircularProgress, Paper, InputLabel, FormHelperText, DialogContentText, FormControlLabel, Badge, useTheme, FormControl, Input, Chip, Tooltip,
|
|
2
|
+
import { DialogTitle as DialogTitle$1, DialogContent as DialogContent$1, DialogActions as DialogActions$1, Grid, Button, withStyles as withStyles$1, alpha, makeStyles, Dialog as Dialog$1, SvgIcon, Collapse, Typography as Typography$1, Checkbox, TextField, InputAdornment, IconButton as IconButton$1, MenuItem, Select, Card, CardContent, CardActions, Snackbar, CircularProgress, Paper, InputLabel, FormHelperText, DialogContentText, FormControlLabel, Badge, useTheme, FormControl, Input, Chip, Tooltip, ListItemIcon, MenuList, Divider, Box, debounce, createStyles as createStyles$1, List, ListItem, ListItemText } from '@material-ui/core';
|
|
3
3
|
import { get, isNil as isNil$1, isEmpty, values, round, isNaN, isNumber } from 'lodash-es';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default, { useState, useRef, useEffect, useMemo, Component, createContext, useContext, useCallback, lazy, Suspense } from 'react';
|
|
@@ -32,7 +32,7 @@ import InsertChartIcon from '@material-ui/icons/InsertChart';
|
|
|
32
32
|
import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
|
|
33
33
|
import SkipNextIcon from '@material-ui/icons/SkipNext';
|
|
34
34
|
import { Line } from 'react-chartjs-2';
|
|
35
|
-
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
35
|
+
import { ClearIcon, LocalizationProvider } from '@mui/x-date-pickers';
|
|
36
36
|
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
|
37
37
|
import moment$3 from 'moment-timezone';
|
|
38
38
|
import PersonPinCircleIcon from '@material-ui/icons/PersonPinCircle';
|
|
@@ -446,11 +446,6 @@ var ModalTreeFilterControl = function (props) {
|
|
|
446
446
|
}
|
|
447
447
|
return branches;
|
|
448
448
|
};
|
|
449
|
-
var handleEntering = function () {
|
|
450
|
-
if (treeRef.current != null) {
|
|
451
|
-
treeRef.current.focus();
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
449
|
var handleCancel = function () {
|
|
455
450
|
onClose();
|
|
456
451
|
if (onHide)
|
|
@@ -562,7 +557,7 @@ var ModalTreeFilterControl = function (props) {
|
|
|
562
557
|
}, onClick: handleCheckboxClick }))), className: "delay-item-node", id: nodes.id.toString(), "data-isbranch": !nodes.isCode }, Array.isArray(nodes.children)
|
|
563
558
|
? nodes.children.map(function (node) { return renderTree(node); })
|
|
564
559
|
: null)); };
|
|
565
|
-
return (React__default.createElement(Dialog$1, __assign({ onClose: onHide ? function () { return onHide(false); } : function () { return null; }, "aria-label": title, maxWidth: "sm",
|
|
560
|
+
return (React__default.createElement(Dialog$1, __assign({ onClose: onHide ? function () { return onHide(false); } : function () { return null; }, "aria-label": title, maxWidth: "sm", disableAutoFocus: true, disableEnforceFocus: true, disableRestoreFocus: true, "aria-labelledby": "confirmation-dialog-title", open: open }, other, { onKeyDown: handleKeyDown }),
|
|
566
561
|
React__default.createElement(DialogTitle$1, { id: "confirmation-dialog-title" }, title),
|
|
567
562
|
isLoading ? (React__default.createElement("div", { style: {
|
|
568
563
|
width: 600,
|
|
@@ -572,13 +567,13 @@ var ModalTreeFilterControl = function (props) {
|
|
|
572
567
|
alignItems: "center"
|
|
573
568
|
} },
|
|
574
569
|
React__default.createElement(LazyLoading, null))) : (React__default.createElement(DialogContent$1, { dividers: true },
|
|
575
|
-
React__default.createElement(TreeView, { className: classes.root, defaultCollapseIcon: React__default.createElement(MinusSquare, null), defaultExpandIcon: React__default.createElement(PlusSquare, null), ref: treeRef, selected: value === undefined ? "" : value.toString(), expanded: expanded, onNodeSelect: handleChange, onNodeToggle: handleToogle }, data && data.id !== undefined && renderTree(data)))),
|
|
570
|
+
React__default.createElement(TreeView, { autoFocus: false, className: classes.root, defaultCollapseIcon: React__default.createElement(MinusSquare, null), defaultExpandIcon: React__default.createElement(PlusSquare, null), ref: treeRef, selected: value === undefined ? "" : value.toString(), expanded: expanded, onNodeSelect: handleChange, onNodeToggle: handleToogle }, data && data.id !== undefined && renderTree(data)))),
|
|
576
571
|
React__default.createElement(DialogActions$1, null,
|
|
577
|
-
React__default.createElement(Button, {
|
|
572
|
+
React__default.createElement(Button, { onClick: handleCancel, color: "primary" }, "Cancel"),
|
|
578
573
|
React__default.createElement(Button, { onClick: handleOk, color: "primary" }, "OK"))));
|
|
579
574
|
};
|
|
580
575
|
|
|
581
|
-
var useStyles$
|
|
576
|
+
var useStyles$v = makeStyles(function (theme) { return ({
|
|
582
577
|
root: {
|
|
583
578
|
width: "100%",
|
|
584
579
|
backgroundColor: theme.palette.background.paper,
|
|
@@ -594,9 +589,9 @@ var useStyles$u = makeStyles(function (theme) { return ({
|
|
|
594
589
|
}
|
|
595
590
|
}); });
|
|
596
591
|
var TreePickerControl = function (props) {
|
|
597
|
-
var classes = useStyles$
|
|
598
|
-
var onSelect = props.onSelect, value = props.value; props.styleLabel; var dataSource = props.dataSource, _a = props.inputTitle, inputTitle = _a === void 0 ? "Asset" : _a; props.showPath; var _c = props.multipleSelectNodes, multipleSelectNodes = _c === void 0 ? false : _c, showAssetTree = props.showAssetTree, onHide = props.onHide,
|
|
599
|
-
var
|
|
592
|
+
var classes = useStyles$v();
|
|
593
|
+
var onSelect = props.onSelect, value = props.value; props.styleLabel; var dataSource = props.dataSource, _a = props.inputTitle, inputTitle = _a === void 0 ? "Asset" : _a; props.showPath; var _c = props.multipleSelectNodes, multipleSelectNodes = _c === void 0 ? false : _c, _d = props.showClearButton, showClearButton = _d === void 0 ? false : _d, showAssetTree = props.showAssetTree, onHide = props.onHide, _e = props.listAssetDrawings, listAssetDrawings = _e === void 0 ? [] : _e, onSuccess = props.onSuccess, isLoading = props.isLoading, other = __rest(props, ["onSelect", "value", "styleLabel", "dataSource", "inputTitle", "showPath", "multipleSelectNodes", "showClearButton", "showAssetTree", "onHide", "listAssetDrawings", "onSuccess", "isLoading"]);
|
|
594
|
+
var _f = useState(false), open = _f[0], setOpen = _f[1];
|
|
600
595
|
var handleClickListItem = function (e) {
|
|
601
596
|
e.stopPropagation();
|
|
602
597
|
setOpen(true);
|
|
@@ -641,20 +636,106 @@ var TreePickerControl = function (props) {
|
|
|
641
636
|
}
|
|
642
637
|
};
|
|
643
638
|
var description = useMemo(function () { return formatDescription(props.description); }, [props.description]);
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
639
|
+
return (React__default.createElement(Grid, { container: true, className: classes.root },
|
|
640
|
+
!showAssetTree ? (React__default.createElement(Grid, { container: true, item: true, md: 12, xs: 12, style: { position: "relative" }, title: props.description },
|
|
641
|
+
React__default.createElement(Grid, { item: true, style: { position: "relative", width: "100%" } },
|
|
642
|
+
React__default.createElement(TextField, { id: "treePickerTextField", label: inputTitle, variant: "outlined", value: description, margin: "dense", autoComplete: "off", fullWidth: true, disabled: true, InputProps: {
|
|
643
|
+
endAdornment: (React__default.createElement(InputAdornment, { position: "end", style: {
|
|
644
|
+
cursor: "pointer"
|
|
645
|
+
} },
|
|
646
|
+
showClearButton && value ? (React__default.createElement(IconButton$1, { "aria-label": "clear input", onClick: function (e) {
|
|
647
|
+
console.log("onClear -> onSelect");
|
|
648
|
+
e.stopPropagation();
|
|
649
|
+
onSelect(0, "", "");
|
|
650
|
+
}, style: {
|
|
651
|
+
cursor: "pointer",
|
|
652
|
+
zIndex: 100
|
|
653
|
+
}, edge: "end" },
|
|
654
|
+
React__default.createElement(ClearIcon, null))) : null,
|
|
655
|
+
React__default.createElement(AccountTreeIcon, { style: {
|
|
656
|
+
cursor: "pointer"
|
|
657
|
+
} })))
|
|
658
|
+
} })),
|
|
659
|
+
React__default.createElement("div", { style: {
|
|
660
|
+
position: "absolute",
|
|
661
|
+
top: 0,
|
|
662
|
+
bottom: 0,
|
|
663
|
+
left: 0,
|
|
664
|
+
right: 0,
|
|
665
|
+
zIndex: 999,
|
|
666
|
+
cursor: "pointer"
|
|
667
|
+
}, onClick: handleClickListItem }))) : (React__default.createElement("div", null)),
|
|
668
|
+
React__default.createElement(Grid, { item: true, xs: 12, md: 12 },
|
|
669
|
+
React__default.createElement(ModalTreeFilterControl, __assign({ classes: {
|
|
670
|
+
paper: classes.paper
|
|
671
|
+
}, onHide: onHide, id: "modal-treeview-filter", title: props.title, keepMounted: true, open: open, onClose: handleClose, isLoading: isLoading, value: value, data: dataSource, onBackdropClick: function () { return setOpen(false); }, multipleSelectNodes: multipleSelectNodes, listAssetDrawings: listAssetDrawings, setListAssetDrawings: listAssetDrawings, onSuccess: onSuccess }, other)))));
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
var useStyles$u = makeStyles(function (theme) { return ({
|
|
675
|
+
root: {
|
|
676
|
+
width: "100%",
|
|
677
|
+
backgroundColor: theme.palette.background.paper,
|
|
678
|
+
"& .MuiInputBase-input": {
|
|
679
|
+
color: "black",
|
|
680
|
+
cursor: "pointer",
|
|
681
|
+
paddingRight: 45
|
|
647
682
|
}
|
|
648
|
-
},
|
|
683
|
+
},
|
|
684
|
+
paper: {
|
|
685
|
+
width: "100%",
|
|
686
|
+
maxHeight: 600
|
|
687
|
+
}
|
|
688
|
+
}); });
|
|
689
|
+
function findNameById(node, id) {
|
|
690
|
+
if (node.id === id) {
|
|
691
|
+
return node.name;
|
|
692
|
+
}
|
|
693
|
+
if (node.children) {
|
|
694
|
+
for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
|
|
695
|
+
var child = _a[_i];
|
|
696
|
+
var result = findNameById(child, id);
|
|
697
|
+
if (result !== null) {
|
|
698
|
+
return result;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
return null;
|
|
703
|
+
}
|
|
704
|
+
var TreePickerControlV2 = function (props) {
|
|
705
|
+
var classes = useStyles$u();
|
|
706
|
+
var value = props.value, onSelect = props.onSelect; props.styleLabel; var dataSource = props.dataSource; props.getOptionName; var _a = props.inputTitle, inputTitle = _a === void 0 ? "Asset" : _a; props.showPath; var _c = props.multipleSelectNodes, multipleSelectNodes = _c === void 0 ? false : _c, _d = props.showClearButton, showClearButton = _d === void 0 ? false : _d, showAssetTree = props.showAssetTree, onHide = props.onHide, _e = props.listAssetDrawings, listAssetDrawings = _e === void 0 ? [] : _e, onSuccess = props.onSuccess, isLoading = props.isLoading, other = __rest(props, ["value", "onSelect", "styleLabel", "dataSource", "getOptionName", "inputTitle", "showPath", "multipleSelectNodes", "showClearButton", "showAssetTree", "onHide", "listAssetDrawings", "onSuccess", "isLoading"]);
|
|
707
|
+
var _f = useState(false), open = _f[0], setOpen = _f[1];
|
|
708
|
+
var handleClickListItem = function (event) {
|
|
709
|
+
event.stopPropagation();
|
|
710
|
+
setOpen(true);
|
|
711
|
+
};
|
|
712
|
+
var handleClose = function (newValue, newDescription, findNode) {
|
|
713
|
+
setOpen(false);
|
|
714
|
+
if (newValue) {
|
|
715
|
+
if (onSelect !== undefined) {
|
|
716
|
+
onSelect(newValue, newDescription, findNode);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
var description = useMemo(function () { return findNameById(dataSource, value) || ""; }, [dataSource, value]);
|
|
649
721
|
return (React__default.createElement(Grid, { container: true, className: classes.root },
|
|
650
722
|
!showAssetTree ? (React__default.createElement(Grid, { container: true, item: true, md: 12, xs: 12, style: { position: "relative" }, title: props.description },
|
|
651
723
|
React__default.createElement(Grid, { item: true, style: { position: "relative", width: "100%" } },
|
|
652
|
-
React__default.createElement(TextField, { id: "treePickerTextField", label: inputTitle, variant: "outlined", value: description, margin: "dense", autoComplete: "off", fullWidth: true, disabled: true
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
724
|
+
React__default.createElement(TextField, { id: "treePickerTextField", label: inputTitle || "", variant: "outlined", value: description, margin: "dense", autoComplete: "off", fullWidth: true, disabled: true, InputProps: {
|
|
725
|
+
endAdornment: (React__default.createElement(InputAdornment, { position: "end", style: {
|
|
726
|
+
cursor: "pointer"
|
|
727
|
+
} },
|
|
728
|
+
showClearButton && value ? (React__default.createElement(IconButton$1, { "aria-label": "clear input", onClick: function (e) {
|
|
729
|
+
e.stopPropagation();
|
|
730
|
+
onSelect(0, "", "");
|
|
731
|
+
}, style: {
|
|
732
|
+
cursor: "pointer",
|
|
733
|
+
zIndex: 100
|
|
734
|
+
}, edge: "end" },
|
|
735
|
+
React__default.createElement(ClearIcon, null))) : null,
|
|
736
|
+
React__default.createElement(AccountTreeIcon, { style: {
|
|
737
|
+
cursor: "pointer"
|
|
738
|
+
} })))
|
|
658
739
|
} })),
|
|
659
740
|
React__default.createElement("div", { style: {
|
|
660
741
|
position: "absolute",
|
|
@@ -668,7 +749,8 @@ var TreePickerControl = function (props) {
|
|
|
668
749
|
React__default.createElement(ModalTreeFilterControl, __assign({ classes: {
|
|
669
750
|
paper: classes.paper
|
|
670
751
|
}, onHide: onHide, id: "modal-treeview-filter", title: props.title, keepMounted: true, open: open, onClose: handleClose, isLoading: isLoading, value: value, data: dataSource, onBackdropClick: function () { return setOpen(false); }, multipleSelectNodes: multipleSelectNodes, listAssetDrawings: listAssetDrawings, setListAssetDrawings: listAssetDrawings, onSuccess: onSuccess }, other)))));
|
|
671
|
-
};
|
|
752
|
+
};
|
|
753
|
+
|
|
672
754
|
var SimpleTextControl = /** @class */ (function (_super) {
|
|
673
755
|
__extends(SimpleTextControl, _super);
|
|
674
756
|
function SimpleTextControl() {
|
|
@@ -7808,7 +7890,7 @@ var useShiftNavigatorManager = function () {
|
|
|
7808
7890
|
var _b = useState(false); _b[0]; var setIsShiftInfoLoading = _b[1];
|
|
7809
7891
|
var _c = useState(""); _c[0]; var setError = _c[1];
|
|
7810
7892
|
var moveShift = function (direction) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7811
|
-
var shiftId, resp;
|
|
7893
|
+
var shiftId, resp, shift;
|
|
7812
7894
|
return __generator(this, function (_a) {
|
|
7813
7895
|
switch (_a.label) {
|
|
7814
7896
|
case 0:
|
|
@@ -7834,11 +7916,13 @@ var useShiftNavigatorManager = function () {
|
|
|
7834
7916
|
case 1:
|
|
7835
7917
|
resp = _a.sent();
|
|
7836
7918
|
if (resp.ok) {
|
|
7837
|
-
|
|
7919
|
+
shift = __assign(__assign({}, resp.data), { CurrentProductionDate: moment$1
|
|
7838
7920
|
.utc(resp.data.CurrentProductionDate)
|
|
7839
7921
|
.toDate(), CurrentStart: moment$1.utc(resp.data.CurrentStart).toDate(), CurrentEnd: moment$1.utc(resp.data.CurrentEnd).toDate(), PreviousProductionDate: moment$1
|
|
7840
7922
|
.utc(resp.data.PreviousProductionDate)
|
|
7841
|
-
.toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() })
|
|
7923
|
+
.toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() });
|
|
7924
|
+
setShiftInfo(shift);
|
|
7925
|
+
return [2 /*return*/, shift];
|
|
7842
7926
|
}
|
|
7843
7927
|
_a.label = 2;
|
|
7844
7928
|
case 2: return [2 /*return*/];
|
|
@@ -7846,7 +7930,7 @@ var useShiftNavigatorManager = function () {
|
|
|
7846
7930
|
});
|
|
7847
7931
|
}); };
|
|
7848
7932
|
var getShiftDataFromAPI = function (productionDate, shiftId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7849
|
-
var resp, e_1;
|
|
7933
|
+
var resp, shift, e_1;
|
|
7850
7934
|
return __generator(this, function (_a) {
|
|
7851
7935
|
switch (_a.label) {
|
|
7852
7936
|
case 0:
|
|
@@ -7861,11 +7945,13 @@ var useShiftNavigatorManager = function () {
|
|
|
7861
7945
|
case 2:
|
|
7862
7946
|
resp = _a.sent();
|
|
7863
7947
|
if (resp.ok) {
|
|
7864
|
-
|
|
7948
|
+
shift = __assign(__assign({}, resp.data), { CurrentProductionDate: moment$1
|
|
7865
7949
|
.utc(resp.data.CurrentProductionDate)
|
|
7866
7950
|
.toDate(), CurrentStart: moment$1.utc(resp.data.CurrentStart).toDate(), CurrentEnd: moment$1.utc(resp.data.CurrentEnd).toDate(), PreviousProductionDate: moment$1
|
|
7867
7951
|
.utc(resp.data.PreviousProductionDate)
|
|
7868
|
-
.toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() })
|
|
7952
|
+
.toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() });
|
|
7953
|
+
setShiftInfo(shift);
|
|
7954
|
+
return [2 /*return*/, shift];
|
|
7869
7955
|
}
|
|
7870
7956
|
return [3 /*break*/, 4];
|
|
7871
7957
|
case 3:
|
|
@@ -7879,7 +7965,7 @@ var useShiftNavigatorManager = function () {
|
|
|
7879
7965
|
});
|
|
7880
7966
|
}); };
|
|
7881
7967
|
var initShiftNavigator = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
7882
|
-
var resp;
|
|
7968
|
+
var resp, shift;
|
|
7883
7969
|
return __generator(this, function (_a) {
|
|
7884
7970
|
switch (_a.label) {
|
|
7885
7971
|
case 0: return [4 /*yield*/, getShiftByParameters({
|
|
@@ -7889,11 +7975,13 @@ var useShiftNavigatorManager = function () {
|
|
|
7889
7975
|
case 1:
|
|
7890
7976
|
resp = _a.sent();
|
|
7891
7977
|
if (resp.ok) {
|
|
7892
|
-
|
|
7978
|
+
shift = __assign(__assign({}, resp.data), { CurrentProductionDate: moment$1
|
|
7893
7979
|
.utc(resp.data.CurrentProductionDate)
|
|
7894
7980
|
.toDate(), CurrentStart: moment$1.utc(resp.data.CurrentStart).toDate(), CurrentEnd: moment$1.utc(resp.data.CurrentEnd).toDate(), PreviousProductionDate: moment$1
|
|
7895
7981
|
.utc(resp.data.PreviousProductionDate)
|
|
7896
|
-
.toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() })
|
|
7982
|
+
.toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() });
|
|
7983
|
+
setShiftInfo(shift);
|
|
7984
|
+
return [2 /*return*/, shift];
|
|
7897
7985
|
}
|
|
7898
7986
|
return [2 /*return*/];
|
|
7899
7987
|
}
|
|
@@ -12296,5 +12384,5 @@ var areaSelector = /*#__PURE__*/Object.freeze({
|
|
|
12296
12384
|
AreaSelector: AreaSelector
|
|
12297
12385
|
});
|
|
12298
12386
|
|
|
12299
|
-
export { Account, AssetProvider, AuthContext, AuthProvider, BarChartControl, ButtonWithLoading, ChangePassword, CheckBoxControl, Configuration$1 as Configuration, ContextMenu$1 as ContextMenu, ContextMenuMESFProvider, CurrencyFormatter, DataGridControl, DateFormatter, DateTimeFormatter, ErrorModal, FetchError, FilterPanel, GenericPanel, GenericTable, GetCrewColor, GetShiftColor, HorizontalTextControl, IntegerFormatter, Login, Logout, LongFilterPanel, MESApiService, MESFMain, MESSAGE_API, MESSAGE_ERRORS, MasterDetailPanel, MesfModal, ModalTreeFilterControl, MultipleSelectorControl, NumberFormatter, NumericTextControl, ShiftDayNavigatorControl, ShiftNavigatorProvider, SimplePasswordControl, SimpleSelectorControl, SimpleTextAreaControl, SimpleTextControl, TimeFormatter, TimeService, TreePickerControl, TrendingsPage, USER_LABELS, UTLSettingsProvider, UploadFileControl, UserProvider, axiosInstance, deleteUser, dxtServerTimeZone, dxtToLocalServerTime, dxtToUTC, formatNumber, getAuthTypes, getCrewStyle, getDataUser, getError, getMomentTz, getProfiles, getShiftByParameters, getShiftStyle, getTokenFromLS, getUsers, renewToken, setPassword, setProfilesToUser, upsertUser, useAssetContext, useContextMenuMESF, useShiftNavigator, useShiftNavigatorManager, useStyles$1 as useStyles, useToken, useUTLSettingsContext, useUserContext };
|
|
12387
|
+
export { Account, AssetProvider, AuthContext, AuthProvider, BarChartControl, ButtonWithLoading, ChangePassword, CheckBoxControl, Configuration$1 as Configuration, ContextMenu$1 as ContextMenu, ContextMenuMESFProvider, CurrencyFormatter, DataGridControl, DateFormatter, DateTimeFormatter, ErrorModal, FetchError, FilterPanel, GenericPanel, GenericTable, GetCrewColor, GetShiftColor, HorizontalTextControl, IntegerFormatter, Login, Logout, LongFilterPanel, MESApiService, MESFMain, MESSAGE_API, MESSAGE_ERRORS, MasterDetailPanel, MesfModal, ModalTreeFilterControl, MultipleSelectorControl, NumberFormatter, NumericTextControl, ShiftDayNavigatorControl, ShiftNavigatorProvider, SimplePasswordControl, SimpleSelectorControl, SimpleTextAreaControl, SimpleTextControl, TimeFormatter, TimeService, TreePickerControl, TreePickerControlV2, TrendingsPage, USER_LABELS, UTLSettingsProvider, UploadFileControl, UserProvider, axiosInstance, deleteUser, dxtServerTimeZone, dxtToLocalServerTime, dxtToUTC, formatNumber, getAuthTypes, getCrewStyle, getDataUser, getError, getMomentTz, getProfiles, getShiftByParameters, getShiftStyle, getTokenFromLS, getUsers, renewToken, setPassword, setProfilesToUser, upsertUser, useAssetContext, useContextMenuMESF, useShiftNavigator, useShiftNavigatorManager, useStyles$1 as useStyles, useToken, useUTLSettingsContext, useUserContext };
|
|
12300
12388
|
//# sourceMappingURL=index.esm.js.map
|