@dexteel/mesf-core 5.7.1 → 5.9.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.
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "5.7.1"
2
+ ".": "5.9.0"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,34 @@
1
+ # Changelog
2
+
3
+ ## [5.9.0](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v5.8.0...@dexteel/mesf-core-v5.9.0) (2025-08-29)
4
+
5
+
6
+ ### Features
7
+
8
+ * **TreePickerControl:** add search functionality with enhanced UX ([#436](https://github.com/dexteel/mesf-core-frontend/issues/436)) ([ae98403](https://github.com/dexteel/mesf-core-frontend/commit/ae9840354e0f56d26c4754e2fefad5ee0fc93e60))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **MESFMain:** add optional theme prop to MESFMain and make login AppBar theme-aware ([#432](https://github.com/dexteel/mesf-core-frontend/issues/432)) ([b736370](https://github.com/dexteel/mesf-core-frontend/commit/b7363700c33bb7049eb98f0023046151aaf50654))
14
+
15
+ ## [5.8.0] - 2025-08-28
16
+
17
+
18
+
19
+ # Changelog
20
+
21
+ ## [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)
22
+
23
+
24
+ ### Features
25
+
26
+ * **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))
27
+
28
+ ## [5.7.1] - 2025-08-25
29
+
30
+
31
+
1
32
  # Changelog
2
33
 
3
34
  ## [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)
@@ -10,6 +10,7 @@ interface Props {
10
10
  showTrendingsIcon?: boolean;
11
11
  byPassHeaderRoutes?: string[];
12
12
  plantAssetId?: number;
13
+ theme?: any;
13
14
  }
14
- declare function MESFMain({ authentication, routes, navbar, navbarTitle, configurations, showAreaSelector, showTrendingsIcon, byPassHeaderRoutes, plantAssetId, }: Props): React.JSX.Element;
15
+ declare function MESFMain({ authentication, routes, navbar, navbarTitle, configurations, showAreaSelector, showTrendingsIcon, byPassHeaderRoutes, plantAssetId, theme, }: Props): React.JSX.Element;
15
16
  export { MESFMain };
@@ -5,6 +5,7 @@ type TreePickerControlProps = {
5
5
  setListAssetDrawings?: Function;
6
6
  onSuccess?: (success: boolean) => void;
7
7
  showClearButton?: boolean;
8
+ allowSearch?: boolean;
8
9
  [key: string]: any;
9
10
  };
10
11
  export declare const TreePickerControl: (props: TreePickerControlProps) => React.JSX.Element;
@@ -30,6 +30,7 @@ interface ModalTreeFilterControlProps {
30
30
  mostUsedCount: number;
31
31
  itemsWithParent: String[];
32
32
  dialogMaxWidth: "xs" | "sm" | "md" | "lg" | "xl";
33
+ allowSearch?: boolean;
33
34
  }
34
35
  declare const ModalTreeFilterControl: React.FC<ModalTreeFilterControlProps>;
35
36
  export { ModalTreeFilterControl };
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
2
  export type ShiftNavigatorDirection = "Previous" | "Next" | "Last";
3
- export declare const ShiftDayNavigatorControl: (props: {
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
@@ -1,11 +1,11 @@
1
1
  export { LicenseManager } from 'ag-grid-enterprise';
2
- import { withStyles, DialogTitle as DialogTitle$1, DialogContent as DialogContent$1, DialogActions as DialogActions$1, createStyles, Grid, Button, alpha, makeStyles, Dialog as Dialog$1, Chip, SvgIcon, Collapse, Typography as Typography$1, Checkbox, TextField, InputAdornment, IconButton as IconButton$1, MenuItem, Box, Card, CardContent, CardActions, Paper, Tooltip, FormControl, InputLabel, Select, ListItemIcon, CircularProgress, Snackbar, FormControlLabel, Switch, DialogContentText, Badge, useTheme, Input, CssBaseline, AppBar, Toolbar, Container, Menu, Hidden, Drawer, List, ListItem, ListItemText, useMediaQuery, Divider, ListSubheader, debounce, createTheme, ThemeProvider } from '@material-ui/core';
2
+ import { withStyles, DialogTitle as DialogTitle$1, DialogContent as DialogContent$1, DialogActions as DialogActions$1, createStyles, Grid, Button, alpha, makeStyles, Dialog as Dialog$1, TextField, Paper, List, ListItem, ListItemIcon, ListItemText, Chip, SvgIcon, Collapse, Typography as Typography$1, Checkbox, InputAdornment, IconButton as IconButton$1, MenuItem, Box, Card, CardContent, CardActions, Tooltip, FormControl, InputLabel, Select, CircularProgress, Snackbar, FormControlLabel, Switch, DialogContentText, Badge, useTheme, Input, CssBaseline, AppBar, Toolbar, Container, Menu, Hidden, Drawer, useMediaQuery, Divider, ListSubheader, debounce, createTheme, ThemeProvider } from '@material-ui/core';
3
3
  import IconButton from '@material-ui/core/IconButton';
4
4
  import CloseIcon from '@material-ui/icons/Close';
5
5
  import Alert$3 from '@material-ui/lab/Alert';
6
6
  import * as React from 'react';
7
7
  import React__default, { useState, useRef, useEffect, useMemo, Component, createContext, useContext, useCallback, lazy, Suspense } from 'react';
8
- import { ArrowBackRounded, ArrowForwardRounded, SkipNext, ChevronLeft, ChevronRight, ArrowRight, Send, Menu as Menu$1, People, Storage, Group, Assignment, Chat, Timeline, ViewList, Build, Settings as Settings$1 } from '@material-ui/icons';
8
+ import { ArrowBackRounded, ArrowForwardRounded, SkipNext, ChevronLeft, ChevronRight, ArrowRight, Send, Menu as Menu$1, People, Storage, Group, Assignment, Chat, Timeline, ViewList, Build, Settings as Settings$2 } from '@material-ui/icons';
9
9
  import { DatePicker } from '@mui/x-date-pickers/DatePicker';
10
10
  import moment$2 from 'moment-timezone';
11
11
  import { useParams, useNavigate, useSearchParams, Link, Navigate, Routes, Route, useLocation, BrowserRouter } from 'react-router-dom';
@@ -13,7 +13,7 @@ import { values, get, isNil, isEmpty, round, isNaN, isNumber } from 'lodash-es';
13
13
  import { ClearIcon, DatePicker as DatePicker$1, CalendarIcon, DateTimePicker, LocalizationProvider } from '@mui/x-date-pickers';
14
14
  import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
15
15
  import MenuIcon from '@material-ui/icons/Menu';
16
- import SettingsIcon from '@material-ui/icons/Settings';
16
+ import Settings$1 from '@material-ui/icons/Settings';
17
17
  import ShowChartIcon from '@material-ui/icons/ShowChart';
18
18
  import AccountCircleIcon from '@material-ui/icons/AccountCircle';
19
19
  import { DndProvider } from 'react-dnd';
@@ -389,8 +389,14 @@ var StyledTreeItem = withStyles(function (theme) { return ({
389
389
  }); })(function (props) { return (React__default.createElement(TreeItem, __assign({}, props, { TransitionComponent: TransitionComponent }))); });
390
390
  var useTreviewStyle = makeStyles(function (theme) { return ({
391
391
  root: {
392
- minHeight: 264,
392
+ minHeight: 350,
393
393
  flexGrow: 1,
394
+ height: "450px",
395
+ overflow: "auto",
396
+ },
397
+ treeContainer: {
398
+ height: "450px",
399
+ overflow: "auto",
394
400
  },
395
401
  treLabelIcon: {
396
402
  marginRight: theme.spacing(1),
@@ -414,17 +420,70 @@ var useTreviewStyle = makeStyles(function (theme) { return ({
414
420
  smallCheckbox: {
415
421
  transform: "scale(0.8)",
416
422
  },
423
+ searchField: {
424
+ marginBottom: theme.spacing(1),
425
+ "& .MuiOutlinedInput-root": {
426
+ padding: "6px 8px",
427
+ },
428
+ "& .MuiInputBase-input": {
429
+ padding: "8px 0px",
430
+ },
431
+ },
432
+ searchResults: {
433
+ position: "absolute",
434
+ zIndex: 1300,
435
+ width: "100%",
436
+ maxHeight: 300,
437
+ overflow: "auto",
438
+ marginTop: theme.spacing(1),
439
+ boxShadow: theme.shadows[3],
440
+ },
441
+ searchResultItem: {
442
+ cursor: "pointer",
443
+ paddingTop: theme.spacing(0.5),
444
+ paddingBottom: theme.spacing(0.5),
445
+ minHeight: "auto",
446
+ "&:hover": {
447
+ backgroundColor: theme.palette.action.hover,
448
+ },
449
+ },
450
+ searchResultPath: {
451
+ fontSize: "0.75rem",
452
+ color: theme.palette.text.secondary,
453
+ fontStyle: "italic",
454
+ marginTop: theme.spacing(0.25),
455
+ },
456
+ searchResultIcon: {
457
+ minWidth: 32,
458
+ },
459
+ searchContainer: {
460
+ position: "sticky",
461
+ top: 0,
462
+ zIndex: 1000,
463
+ backgroundColor: theme.palette.background.paper,
464
+ borderBottom: "1px solid ".concat(theme.palette.divider),
465
+ paddingBottom: theme.spacing(0.5),
466
+ marginBottom: theme.spacing(0.5),
467
+ },
417
468
  }); });
418
469
  var ModalTreeFilterControl = function (props) {
419
- var onClose = props.onClose, valueProp = props.value, open = props.open, title = props.title, data = props.data, selectBranch = props.selectBranch, selectActive = props.selectActive, selectInternal = props.selectInternal, multipleSelectNodes = props.multipleSelectNodes, onHide = props.onHide, listAssetDrawings = props.listAssetDrawings, setListAssetDrawings = props.setListAssetDrawings, onSuccess = props.onSuccess, isLoading = props.isLoading, mostUsedCount = props.mostUsedCount, itemsWithParent = props.itemsWithParent, _a = props.dialogMaxWidth, dialogMaxWidth = _a === void 0 ? "sm" : _a, other = __rest(props, ["onClose", "value", "open", "title", "data", "selectBranch", "selectActive", "selectInternal", "multipleSelectNodes", "onHide", "listAssetDrawings", "setListAssetDrawings", "onSuccess", "isLoading", "mostUsedCount", "itemsWithParent", "dialogMaxWidth"]);
420
- var _b = useState(valueProp), value = _b[0], setValue = _b[1];
421
- var _c = useState([]), expanded = _c[0], setExpanded = _c[1];
470
+ var onClose = props.onClose, valueProp = props.value, open = props.open, title = props.title, data = props.data, selectBranch = props.selectBranch, selectActive = props.selectActive, selectInternal = props.selectInternal, multipleSelectNodes = props.multipleSelectNodes, onHide = props.onHide, listAssetDrawings = props.listAssetDrawings, setListAssetDrawings = props.setListAssetDrawings, onSuccess = props.onSuccess, isLoading = props.isLoading, mostUsedCount = props.mostUsedCount, itemsWithParent = props.itemsWithParent, _a = props.dialogMaxWidth, dialogMaxWidth = _a === void 0 ? "sm" : _a, _b = props.allowSearch, allowSearch = _b === void 0 ? false : _b, other = __rest(props, ["onClose", "value", "open", "title", "data", "selectBranch", "selectActive", "selectInternal", "multipleSelectNodes", "onHide", "listAssetDrawings", "setListAssetDrawings", "onSuccess", "isLoading", "mostUsedCount", "itemsWithParent", "dialogMaxWidth", "allowSearch"]);
471
+ var _c = useState(valueProp), value = _c[0], setValue = _c[1];
472
+ var _d = useState([]), expanded = _d[0], setExpanded = _d[1];
422
473
  var treeRef = useRef(null);
423
- var _d = useState([]), selectedNodes = _d[0], setSelectedNodes = _d[1];
474
+ var _e = useState([]), selectedNodes = _e[0], setSelectedNodes = _e[1];
475
+ var _f = useState(""), searchTerm = _f[0], setSearchTerm = _f[1];
476
+ var _g = useState([]), searchResults = _g[0], setSearchResults = _g[1];
477
+ var _h = useState(false), showSearchResults = _h[0], setShowSearchResults = _h[1];
478
+ var searchTimeoutRef = useRef(null);
424
479
  var classes = useTreviewStyle();
425
480
  useEffect(function () {
426
481
  if (!open) {
427
482
  setValue(valueProp);
483
+ // Clear search when dialog closes
484
+ setSearchTerm("");
485
+ setSearchResults([]);
486
+ setShowSearchResults(false);
428
487
  }
429
488
  else {
430
489
  if (valueProp !== undefined)
@@ -577,6 +636,83 @@ var ModalTreeFilterControl = function (props) {
577
636
  });
578
637
  return treeArray;
579
638
  }
639
+ // Pre-build search index for better performance with large trees
640
+ var searchIndex = useMemo(function () {
641
+ var index = [];
642
+ var buildIndex = function (currentNode, path) {
643
+ if (path === void 0) { path = []; }
644
+ var nodePath = __spreadArray(__spreadArray([], path, true), [currentNode.name], false);
645
+ var pathStr = nodePath.join("/");
646
+ // Determine if node has children - use isLeaf if available, otherwise check children array
647
+ var hasChildren = currentNode.isLeaf === undefined
648
+ ? Boolean(currentNode.children && currentNode.children.length > 0)
649
+ : !currentNode.isLeaf;
650
+ index.push({
651
+ id: currentNode.id,
652
+ name: currentNode.name,
653
+ path: pathStr,
654
+ isCode: currentNode.isCode,
655
+ hasChildren: hasChildren,
656
+ node: currentNode,
657
+ });
658
+ if (currentNode.children) {
659
+ for (var _i = 0, _a = currentNode.children; _i < _a.length; _i++) {
660
+ var child = _a[_i];
661
+ buildIndex(child, nodePath);
662
+ }
663
+ }
664
+ };
665
+ if (data && data.children) {
666
+ for (var _i = 0, _a = data.children; _i < _a.length; _i++) {
667
+ var child = _a[_i];
668
+ buildIndex(child);
669
+ }
670
+ }
671
+ return index;
672
+ }, [data]);
673
+ var searchNodes = function (searchTerm) {
674
+ var lowerSearchTerm = searchTerm.toLowerCase();
675
+ return searchIndex.filter(function (item) {
676
+ return item.name.toLowerCase().includes(lowerSearchTerm);
677
+ });
678
+ };
679
+ var handleSearchChange = function (event) {
680
+ var term = event.target.value;
681
+ setSearchTerm(term);
682
+ // Clear existing timeout
683
+ if (searchTimeoutRef.current) {
684
+ clearTimeout(searchTimeoutRef.current);
685
+ }
686
+ if (term.trim() === "" || term.length < 2) {
687
+ setSearchResults([]);
688
+ setShowSearchResults(false);
689
+ return;
690
+ }
691
+ // Add debounce
692
+ searchTimeoutRef.current = setTimeout(function () {
693
+ var results = searchNodes(term);
694
+ setSearchResults(results);
695
+ setShowSearchResults(results.length > 0);
696
+ }, 250);
697
+ };
698
+ var handleSearchResultClick = function (result) {
699
+ // Expand to node
700
+ var expandedNode = getNodeParent(data, result.id, []);
701
+ setExpanded(expandedNode);
702
+ // Select the node
703
+ setValue(result.id);
704
+ // Clear search
705
+ setSearchTerm("");
706
+ setSearchResults([]);
707
+ setShowSearchResults(false);
708
+ // Scroll to node after a small delay to ensure tree is expanded
709
+ setTimeout(function () {
710
+ var nodeElement = document.getElementById(result.id.toString());
711
+ if (nodeElement) {
712
+ nodeElement.scrollIntoView({ behavior: "smooth", block: "center" });
713
+ }
714
+ }, 100);
715
+ };
580
716
  var renderTree = function (nodes) { return (React__default.createElement(StyledTreeItem, { isChecked: selectedNodes.includes(nodes.id), key: nodes.id, nodeId: nodes.id.toString(), label: React__default.createElement("div", { className: classes.treeLabelRoot },
581
717
  nodes.isCode === true && (React__default.createElement(Code, { className: classes.treLabelIcon, htmlColor: "#1ABC9C" })),
582
718
  nodes.isCode === false && (React__default.createElement(FolderIcon, { className: classes.treLabelIcon, htmlColor: "#F1C40F" })),
@@ -601,28 +737,39 @@ var ModalTreeFilterControl = function (props) {
601
737
  justifyContent: "center",
602
738
  alignItems: "center",
603
739
  } },
604
- React__default.createElement(LazyLoading, null))) : (React__default.createElement(DialogContent$1, { dividers: true },
605
- 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 && (React__default.createElement(Grid, null,
606
- mostUsedCount > 0 && (React__default.createElement(Grid, { item: true, md: 12 }, treeToArray(data)
607
- .sort(function (a, b) {
608
- if (!a.sortOrder)
609
- return 1;
610
- if (!b.sortOrder)
611
- return -1;
612
- var valA = a.sortOrder;
613
- var valB = b.sortOrder;
614
- return valA - valB;
615
- })
616
- .slice(0, mostUsedCount)
617
- .map(function (node) { return (React__default.createElement(Button, { onClick: function () {
618
- onClose(node.id, node.name);
619
- if (onSuccess)
620
- onSuccess(true);
621
- }, style: { marginRight: 5, marginBottom: 8 } },
622
- React__default.createElement(Chip, { label: itemsWithParent.includes(node.name)
623
- ? "".concat(node.parentName, "/").concat(node.name)
624
- : node.name, size: "medium", variant: "outlined", style: { cursor: "pointer" } }))); }))),
625
- renderTree(data)))))),
740
+ React__default.createElement(LazyLoading, null))) : (React__default.createElement(DialogContent$1, { dividers: true, style: { height: "500px", overflow: "hidden" } },
741
+ allowSearch && (React__default.createElement("div", { className: classes.searchContainer },
742
+ React__default.createElement(TextField, { className: classes.searchField, placeholder: "Search items (min. 2 characters)...", variant: "outlined", size: "small", fullWidth: true, value: searchTerm, onChange: handleSearchChange, InputProps: {
743
+ startAdornment: (React__default.createElement(SearchIcon, { style: { marginRight: 8, color: "#999" } })),
744
+ } }),
745
+ showSearchResults && (React__default.createElement(Paper, { className: classes.searchResults },
746
+ React__default.createElement(List, null, searchResults.map(function (result) { return (React__default.createElement(ListItem, { key: result.id, button: true, className: classes.searchResultItem, onClick: function () { return handleSearchResultClick(result); } },
747
+ React__default.createElement(ListItemIcon, { className: classes.searchResultIcon }, result.hasChildren ? (React__default.createElement(AccountTreeIcon, { color: "primary", fontSize: "small" })) : (React__default.createElement(Settings$1, { color: "primary", fontSize: "small" }))),
748
+ React__default.createElement(ListItemText, { primary: result.name, secondary: result.path, classes: {
749
+ secondary: classes.searchResultPath,
750
+ } }))); })))))),
751
+ React__default.createElement("div", { className: classes.treeContainer },
752
+ 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 && (React__default.createElement(Grid, null,
753
+ mostUsedCount > 0 && (React__default.createElement(Grid, { item: true, md: 12 }, treeToArray(data)
754
+ .sort(function (a, b) {
755
+ if (!a.sortOrder)
756
+ return 1;
757
+ if (!b.sortOrder)
758
+ return -1;
759
+ var valA = a.sortOrder;
760
+ var valB = b.sortOrder;
761
+ return valA - valB;
762
+ })
763
+ .slice(0, mostUsedCount)
764
+ .map(function (node) { return (React__default.createElement(Button, { onClick: function () {
765
+ onClose(node.id, node.name);
766
+ if (onSuccess)
767
+ onSuccess(true);
768
+ }, style: { marginRight: 5, marginBottom: 8 } },
769
+ React__default.createElement(Chip, { label: itemsWithParent.includes(node.name)
770
+ ? "".concat(node.parentName, "/").concat(node.name)
771
+ : node.name, size: "medium", variant: "outlined", style: { cursor: "pointer" } }))); }))),
772
+ renderTree(data))))))),
626
773
  React__default.createElement(DialogActions$1, null,
627
774
  React__default.createElement(Button, { onClick: handleCancel, color: "primary" }, "Cancel"),
628
775
  React__default.createElement(Button, { onClick: function () { return handleOk(); }, color: "primary" }, "OK"))));
@@ -645,8 +792,8 @@ var useStyles$I = makeStyles(function (theme) { return ({
645
792
  }); });
646
793
  var TreePickerControl = function (props) {
647
794
  var classes = useStyles$I();
648
- 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"]);
649
- var _f = useState(showAssetTree || false), open = _f[0], setOpen = _f[1];
795
+ 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, _f = props.allowSearch, allowSearch = _f === void 0 ? false : _f, other = __rest(props, ["onSelect", "value", "styleLabel", "dataSource", "inputTitle", "showPath", "multipleSelectNodes", "showClearButton", "showAssetTree", "onHide", "listAssetDrawings", "onSuccess", "isLoading", "allowSearch"]);
796
+ var _g = useState(showAssetTree || false), open = _g[0], setOpen = _g[1];
650
797
  var handleClickListItem = function (e) {
651
798
  e.stopPropagation();
652
799
  setOpen(true);
@@ -725,7 +872,7 @@ var TreePickerControl = function (props) {
725
872
  React__default.createElement(Grid, { item: true, xs: 12, md: 12 },
726
873
  React__default.createElement(ModalTreeFilterControl, __assign({ classes: {
727
874
  paper: classes.paper,
728
- }, 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)))));
875
+ }, onHide: onHide, id: "modal-treeview-filters", 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, allowSearch: allowSearch }, other)))));
729
876
  };
730
877
 
731
878
  var useStyles$H = makeStyles(function (theme) { return ({
@@ -1394,11 +1541,12 @@ var ShiftNavigatorProvider = function (_a) {
1394
1541
  return (React__default.createElement(ShiftNavigatorContext.Provider, { value: shiftNavigatorManager }, children));
1395
1542
  };
1396
1543
 
1397
- var ShiftDayNavigatorControl = function (props) {
1398
- var _a;
1399
- var _b = useShiftNavigator(), shiftInfo = _b.shiftInfo, initShiftNavigator = _b.initShiftNavigator, moveShift = _b.moveShift, getShiftDataFromAPI = _b.getShiftDataFromAPI;
1400
- var _c = useState(shiftInfo), shiftInfoCopy = _c[0], setShiftInfoCopy = _c[1];
1401
- var _d = useState(""); _d[0]; var setError = _d[1];
1544
+ var ShiftDayNavigatorControl = function (_a) {
1545
+ var _b;
1546
+ var useRouter = _a.useRouter, onShiftChange = _a.onShiftChange, preventInit = _a.preventInit, _c = _a.withPaper, withPaper = _c === void 0 ? true : _c;
1547
+ var _d = useShiftNavigator(), shiftInfo = _d.shiftInfo, initShiftNavigator = _d.initShiftNavigator, moveShift = _d.moveShift, getShiftDataFromAPI = _d.getShiftDataFromAPI;
1548
+ var _e = useState(shiftInfo), shiftInfoCopy = _e[0], setShiftInfoCopy = _e[1];
1549
+ var _f = useState(""); _f[0]; var setError = _f[1];
1402
1550
  var shiftId = useParams().shiftId;
1403
1551
  var firstRender = useRef(true);
1404
1552
  var updateHistory = function (shiftId) {
@@ -1406,8 +1554,8 @@ var ShiftDayNavigatorControl = function (props) {
1406
1554
  window.history.replaceState(null, "", "/".concat(paths[1]) + "/".concat(shiftId));
1407
1555
  };
1408
1556
  if (shiftInfo !== null && shiftInfo.CurrentShiftId) {
1409
- if (props.useRouter) {
1410
- updateHistory((_a = shiftInfo === null || shiftInfo === void 0 ? void 0 : shiftInfo.CurrentShiftId) === null || _a === void 0 ? void 0 : _a.toString());
1557
+ if (useRouter) {
1558
+ updateHistory((_b = shiftInfo === null || shiftInfo === void 0 ? void 0 : shiftInfo.CurrentShiftId) === null || _b === void 0 ? void 0 : _b.toString());
1411
1559
  }
1412
1560
  }
1413
1561
  useEffect(function () {
@@ -1454,62 +1602,62 @@ var ShiftDayNavigatorControl = function (props) {
1454
1602
  useEffect(function () {
1455
1603
  if (firstRender.current) {
1456
1604
  firstRender.current = false;
1457
- if (props.preventInit) {
1605
+ if (preventInit) {
1458
1606
  return;
1459
1607
  }
1460
- if (props.useRouter && shiftId) {
1608
+ if (useRouter && shiftId) {
1461
1609
  getShiftDataFromAPI(null, Number(shiftId)).then(function () {
1462
- props.onShiftChange && props.onShiftChange(Number(shiftId));
1610
+ onShiftChange && onShiftChange(Number(shiftId));
1463
1611
  });
1464
1612
  }
1465
1613
  else {
1466
1614
  initShiftNavigator().then(function () {
1467
- props.onShiftChange && props.onShiftChange(Number(shiftId));
1615
+ onShiftChange && onShiftChange(Number(shiftId));
1468
1616
  });
1469
1617
  }
1470
1618
  }
1471
1619
  }, []);
1472
- return (React__default.createElement(Paper, null,
1473
- 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",
1495
- },
1620
+ var gridContent = (React__default.createElement(Grid, { item: true, container: true, style: { minWidth: "0%", margin: "1rem" }, direction: "row", justifyContent: "flex-start", alignItems: "center", spacing: 1 },
1621
+ React__default.createElement(Grid, { item: true },
1622
+ React__default.createElement(Tooltip, { title: "Previous Shift" },
1623
+ React__default.createElement(IconButton$1, { "aria-label": "Previous Shift", color: "primary", disabled: !(shiftInfo === null || shiftInfo === void 0 ? void 0 : shiftInfo.PreviousShiftId), onClick: function () {
1624
+ moveShift("Previous").then(function () { });
1625
+ }, size: "small" },
1626
+ React__default.createElement(ArrowBackRounded, null)))),
1627
+ React__default.createElement(Grid, { item: true },
1628
+ 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) {
1629
+ if (date) {
1630
+ getShiftDataFromAPI(date.toDate(), 0).then(function () { });
1631
+ }
1632
+ }, slots: {
1633
+ textField: TextField,
1634
+ }, slotProps: {
1635
+ textField: {
1636
+ variant: "outlined",
1637
+ size: "small",
1638
+ inputProps: {
1639
+ style: {
1640
+ textAlign: "center",
1641
+ width: "110px",
1496
1642
  },
1497
1643
  },
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)))))));
1644
+ },
1645
+ } })),
1646
+ React__default.createElement(Grid, { item: true, style: { maxWidth: "100px" } },
1647
+ 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" })),
1648
+ React__default.createElement(Grid, { item: true },
1649
+ React__default.createElement(Tooltip, { title: "Next Shift" },
1650
+ React__default.createElement(IconButton$1, { "aria-label": "next", color: "primary", disabled: !(shiftInfoCopy === null || shiftInfoCopy === void 0 ? void 0 : shiftInfoCopy.NextShiftId), onClick: function () {
1651
+ moveShift("Next").then(function () { });
1652
+ }, size: "small" },
1653
+ React__default.createElement(ArrowForwardRounded, null)))),
1654
+ React__default.createElement(Grid, { item: true },
1655
+ React__default.createElement(Tooltip, { title: "Last Shift" },
1656
+ 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 () {
1657
+ moveShift("Last").then(function () { });
1658
+ }, size: "small" },
1659
+ React__default.createElement(SkipNext, null))))));
1660
+ return withPaper !== false ? React__default.createElement(Paper, null, gridContent) : gridContent;
1513
1661
  };
1514
1662
 
1515
1663
  var getShiftsRangeByParameters = function (period_1) {
@@ -9651,7 +9799,7 @@ var useStyles$8 = makeStyles(function (theme) { return ({
9651
9799
  flexDirection: "column",
9652
9800
  },
9653
9801
  appBar: {
9654
- backgroundColor: "#3f51b5",
9802
+ backgroundColor: theme.palette.primary.main,
9655
9803
  boxShadow: "0 4px 20px 0 rgba(0, 0, 0, 0.1)",
9656
9804
  },
9657
9805
  brand: {
@@ -9981,7 +10129,7 @@ function Header$1(_a) {
9981
10129
  React__default.createElement(ShowChartIcon, null)))),
9982
10130
  canShowSettings && (React__default.createElement(Tooltip, { title: "Settings", placement: "bottom" },
9983
10131
  React__default.createElement(IconButton$1, { color: "inherit", component: Link, to: "/configuration" },
9984
- React__default.createElement(SettingsIcon, null)))),
10132
+ React__default.createElement(Settings$1, null)))),
9985
10133
  showAreaSelector && (React__default.createElement(Suspense, { fallback: React__default.createElement("div", null, "...") },
9986
10134
  React__default.createElement(AreaSelector$1, null))),
9987
10135
  React__default.createElement(TimeAndUserMenu, null)))),
@@ -11192,7 +11340,7 @@ var Configuration = function () {
11192
11340
  React__default.createElement(ListItemText, { primary: "Jobs" })),
11193
11341
  React__default.createElement(ListItem, { button: true, selected: option === "settings", component: Link, to: "/configuration/settings" },
11194
11342
  React__default.createElement(ListItemIcon, null,
11195
- React__default.createElement(Settings$1, null)),
11343
+ React__default.createElement(Settings$2, null)),
11196
11344
  React__default.createElement(ListItemText, { primary: "Settings" }))))); };
11197
11345
  useEffect(function () {
11198
11346
  var handleListItemClick = function (event) {
@@ -14376,10 +14524,10 @@ var timezone = TimeService.getInstance().getServerTimeZone();
14376
14524
  moment$2.tz.setDefault(timezone);
14377
14525
  var base = document.getElementsByTagName("base")[0].getAttribute("href") || "/";
14378
14526
  function MESFMain(_a) {
14379
- var authentication = _a.authentication, routes = _a.routes, navbar = _a.navbar, _b = _a.navbarTitle, navbarTitle = _b === void 0 ? "MESF" : _b, configurations = _a.configurations, _c = _a.showAreaSelector, showAreaSelector = _c === void 0 ? false : _c, _d = _a.showTrendingsIcon, showTrendingsIcon = _d === void 0 ? true : _d, _e = _a.byPassHeaderRoutes, byPassHeaderRoutes = _e === void 0 ? [] : _e, _f = _a.plantAssetId, plantAssetId = _f === void 0 ? 1 : _f;
14527
+ var authentication = _a.authentication, routes = _a.routes, navbar = _a.navbar, _b = _a.navbarTitle, navbarTitle = _b === void 0 ? "MESF" : _b, configurations = _a.configurations, _c = _a.showAreaSelector, showAreaSelector = _c === void 0 ? false : _c, _d = _a.showTrendingsIcon, showTrendingsIcon = _d === void 0 ? true : _d, _e = _a.byPassHeaderRoutes, byPassHeaderRoutes = _e === void 0 ? [] : _e, _f = _a.plantAssetId, plantAssetId = _f === void 0 ? 1 : _f, _g = _a.theme, theme = _g === void 0 ? themeMESF : _g;
14380
14528
  return (React__default.createElement(React__default.Fragment, null,
14381
14529
  React__default.createElement(CssBaseline, null),
14382
- React__default.createElement(ThemeProvider, { theme: themeMESF },
14530
+ React__default.createElement(ThemeProvider, { theme: theme },
14383
14531
  React__default.createElement(AuthProvider, { authConfig: authentication },
14384
14532
  React__default.createElement(LocalizationProvider, { dateAdapter: AdapterMoment, dateLibInstance: moment$2 },
14385
14533
  React__default.createElement(UserProvider, null,