@dexteel/mesf-core 5.9.0 → 5.10.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 +31 -0
- package/dist/configuration/pages/log/components/Filters/dateFilter.d.ts +3 -1
- package/dist/controls/filters/TreePickerControlV2.d.ts +1 -0
- package/dist/index.esm.js +243 -137
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -9,7 +9,7 @@ import { ArrowBackRounded, ArrowForwardRounded, SkipNext, ChevronLeft, ChevronRi
|
|
|
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';
|
|
12
|
-
import { values, get, isNil, isEmpty, round, isNaN, isNumber } from 'lodash-es';
|
|
12
|
+
import { values, get, isNil, isEmpty, round, isNaN as isNaN$1, 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';
|
|
@@ -22,8 +22,8 @@ import { themeMaterial } from 'ag-grid-community';
|
|
|
22
22
|
import { AgGridReact } from 'ag-grid-react';
|
|
23
23
|
import MomentUtils from '@date-io/moment';
|
|
24
24
|
import { MuiPickersUtilsProvider, KeyboardDatePicker, KeyboardTimePicker } from '@material-ui/pickers';
|
|
25
|
-
import { isNil as isNil$1, get as get$1 } from 'lodash';
|
|
26
25
|
import moment$3 from 'moment';
|
|
26
|
+
import { isNil as isNil$1, get as get$1 } from 'lodash';
|
|
27
27
|
import EditIcon from '@material-ui/icons/Edit';
|
|
28
28
|
import PlaylistAddIcon from '@material-ui/icons/PlaylistAdd';
|
|
29
29
|
import { HubConnectionBuilder, LogLevel } from '@microsoft/signalr';
|
|
@@ -383,7 +383,9 @@ var StyledTreeItem = withStyles(function (theme) { return ({
|
|
|
383
383
|
},
|
|
384
384
|
label: {
|
|
385
385
|
backgroundColor: function (props) {
|
|
386
|
-
return props.isChecked
|
|
386
|
+
return props.isChecked
|
|
387
|
+
? alpha(theme.palette.primary.main, 0.8) + " !important"
|
|
388
|
+
: "inherit";
|
|
387
389
|
},
|
|
388
390
|
},
|
|
389
391
|
}); })(function (props) { return (React__default.createElement(TreeItem, __assign({}, props, { TransitionComponent: TransitionComponent }))); });
|
|
@@ -391,12 +393,20 @@ var useTreviewStyle = makeStyles(function (theme) { return ({
|
|
|
391
393
|
root: {
|
|
392
394
|
minHeight: 350,
|
|
393
395
|
flexGrow: 1,
|
|
394
|
-
height: "
|
|
396
|
+
height: "100%",
|
|
395
397
|
overflow: "auto",
|
|
398
|
+
overflowX: "hidden",
|
|
399
|
+
width: "100%",
|
|
396
400
|
},
|
|
397
401
|
treeContainer: {
|
|
398
|
-
|
|
402
|
+
flex: 1,
|
|
399
403
|
overflow: "auto",
|
|
404
|
+
display: "flex",
|
|
405
|
+
flexDirection: "column",
|
|
406
|
+
paddingTop: theme.spacing(1),
|
|
407
|
+
paddingLeft: theme.spacing(2),
|
|
408
|
+
paddingRight: theme.spacing(2),
|
|
409
|
+
paddingBottom: theme.spacing(2),
|
|
400
410
|
},
|
|
401
411
|
treLabelIcon: {
|
|
402
412
|
marginRight: theme.spacing(1),
|
|
@@ -446,6 +456,11 @@ var useTreviewStyle = makeStyles(function (theme) { return ({
|
|
|
446
456
|
"&:hover": {
|
|
447
457
|
backgroundColor: theme.palette.action.hover,
|
|
448
458
|
},
|
|
459
|
+
"&.focused": {
|
|
460
|
+
backgroundColor: theme.palette.action.selected,
|
|
461
|
+
outline: "2px solid ".concat(theme.palette.primary.main),
|
|
462
|
+
outlineOffset: "-2px",
|
|
463
|
+
},
|
|
449
464
|
},
|
|
450
465
|
searchResultPath: {
|
|
451
466
|
fontSize: "0.75rem",
|
|
@@ -462,6 +477,7 @@ var useTreviewStyle = makeStyles(function (theme) { return ({
|
|
|
462
477
|
zIndex: 1000,
|
|
463
478
|
backgroundColor: theme.palette.background.paper,
|
|
464
479
|
borderBottom: "1px solid ".concat(theme.palette.divider),
|
|
480
|
+
padding: theme.spacing(1),
|
|
465
481
|
paddingBottom: theme.spacing(0.5),
|
|
466
482
|
marginBottom: theme.spacing(0.5),
|
|
467
483
|
},
|
|
@@ -475,7 +491,11 @@ var ModalTreeFilterControl = function (props) {
|
|
|
475
491
|
var _f = useState(""), searchTerm = _f[0], setSearchTerm = _f[1];
|
|
476
492
|
var _g = useState([]), searchResults = _g[0], setSearchResults = _g[1];
|
|
477
493
|
var _h = useState(false), showSearchResults = _h[0], setShowSearchResults = _h[1];
|
|
494
|
+
var _j = useState(-1), focusedSearchIndex = _j[0], setFocusedSearchIndex = _j[1];
|
|
478
495
|
var searchTimeoutRef = useRef(null);
|
|
496
|
+
var searchContainerRef = useRef(null);
|
|
497
|
+
var searchResultsRefs = useRef([]);
|
|
498
|
+
var searchInputRef = useRef(null);
|
|
479
499
|
var classes = useTreviewStyle();
|
|
480
500
|
useEffect(function () {
|
|
481
501
|
if (!open) {
|
|
@@ -484,12 +504,40 @@ var ModalTreeFilterControl = function (props) {
|
|
|
484
504
|
setSearchTerm("");
|
|
485
505
|
setSearchResults([]);
|
|
486
506
|
setShowSearchResults(false);
|
|
507
|
+
setFocusedSearchIndex(-1);
|
|
487
508
|
}
|
|
488
509
|
else {
|
|
489
|
-
if (valueProp !== undefined)
|
|
510
|
+
if (valueProp !== undefined) {
|
|
490
511
|
expandNode(valueProp);
|
|
512
|
+
// Scroll to the selected node when dialog opens
|
|
513
|
+
setTimeout(function () {
|
|
514
|
+
var nodeElement = document.getElementById(valueProp.toString());
|
|
515
|
+
if (nodeElement) {
|
|
516
|
+
nodeElement.scrollIntoView({
|
|
517
|
+
behavior: "smooth",
|
|
518
|
+
block: "center",
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
}, 300);
|
|
522
|
+
}
|
|
523
|
+
// Auto-focus search input when dialog opens and search is allowed
|
|
524
|
+
if (allowSearch) {
|
|
525
|
+
setTimeout(function () {
|
|
526
|
+
// Try multiple ways to focus the search input
|
|
527
|
+
if (searchInputRef.current) {
|
|
528
|
+
searchInputRef.current.focus();
|
|
529
|
+
}
|
|
530
|
+
else {
|
|
531
|
+
// Fallback: find input by placeholder
|
|
532
|
+
var searchInput = document.querySelector('input[placeholder*="Search"]');
|
|
533
|
+
if (searchInput) {
|
|
534
|
+
searchInput.focus();
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}, 200);
|
|
538
|
+
}
|
|
491
539
|
}
|
|
492
|
-
}, [valueProp, open]);
|
|
540
|
+
}, [valueProp, open, allowSearch]);
|
|
493
541
|
useEffect(function () {
|
|
494
542
|
if (Array.isArray(listAssetDrawings) && listAssetDrawings.length >= 1) {
|
|
495
543
|
setSelectedNodes(listAssetDrawings);
|
|
@@ -515,6 +563,11 @@ var ModalTreeFilterControl = function (props) {
|
|
|
515
563
|
return branches;
|
|
516
564
|
};
|
|
517
565
|
var handleCancel = function () {
|
|
566
|
+
setSearchTerm("");
|
|
567
|
+
setSearchResults([]);
|
|
568
|
+
setShowSearchResults(false);
|
|
569
|
+
setFocusedSearchIndex(-1);
|
|
570
|
+
setValue(valueProp);
|
|
518
571
|
onClose();
|
|
519
572
|
if (onHide)
|
|
520
573
|
onHide(false);
|
|
@@ -543,7 +596,55 @@ var ModalTreeFilterControl = function (props) {
|
|
|
543
596
|
};
|
|
544
597
|
var handleKeyDown = function (event) {
|
|
545
598
|
if (event.key === "Escape") {
|
|
546
|
-
|
|
599
|
+
// Clear search if showing results, otherwise close dialog
|
|
600
|
+
if (showSearchResults) {
|
|
601
|
+
setSearchTerm("");
|
|
602
|
+
setSearchResults([]);
|
|
603
|
+
setShowSearchResults(false);
|
|
604
|
+
setFocusedSearchIndex(-1);
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
// Reset everything when closing with ESC
|
|
608
|
+
setSearchTerm("");
|
|
609
|
+
setSearchResults([]);
|
|
610
|
+
setShowSearchResults(false);
|
|
611
|
+
setFocusedSearchIndex(-1);
|
|
612
|
+
setValue(valueProp);
|
|
613
|
+
onClose();
|
|
614
|
+
}
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
// Handle keyboard navigation in search results
|
|
618
|
+
if (showSearchResults && searchResults.length > 0) {
|
|
619
|
+
if (event.key === "ArrowDown") {
|
|
620
|
+
event.preventDefault();
|
|
621
|
+
var newIndex_1 = focusedSearchIndex < searchResults.length - 1
|
|
622
|
+
? focusedSearchIndex + 1
|
|
623
|
+
: 0;
|
|
624
|
+
setFocusedSearchIndex(newIndex_1);
|
|
625
|
+
// Scroll to the focused item
|
|
626
|
+
setTimeout(function () { return scrollFocusedItemIntoView(newIndex_1); }, 0);
|
|
627
|
+
}
|
|
628
|
+
else if (event.key === "ArrowUp") {
|
|
629
|
+
event.preventDefault();
|
|
630
|
+
var newIndex_2 = focusedSearchIndex > 0
|
|
631
|
+
? focusedSearchIndex - 1
|
|
632
|
+
: searchResults.length - 1;
|
|
633
|
+
setFocusedSearchIndex(newIndex_2);
|
|
634
|
+
// Scroll to the focused item
|
|
635
|
+
setTimeout(function () { return scrollFocusedItemIntoView(newIndex_2); }, 0);
|
|
636
|
+
}
|
|
637
|
+
else if (event.key === "Enter" && focusedSearchIndex >= 0) {
|
|
638
|
+
event.preventDefault();
|
|
639
|
+
var selectedResult = searchResults[focusedSearchIndex];
|
|
640
|
+
if (selectedResult) {
|
|
641
|
+
handleSearchResultClick(selectedResult);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
else if (event.key === "Enter" && !showSearchResults) {
|
|
646
|
+
event.preventDefault();
|
|
647
|
+
handleOk();
|
|
547
648
|
}
|
|
548
649
|
};
|
|
549
650
|
var handleCheckboxClick = function (event) {
|
|
@@ -570,9 +671,11 @@ var ModalTreeFilterControl = function (props) {
|
|
|
570
671
|
return [];
|
|
571
672
|
};
|
|
572
673
|
var expandNode = function (nodeId) {
|
|
573
|
-
var
|
|
574
|
-
|
|
575
|
-
|
|
674
|
+
var pathToNode = getNodeParent(data, nodeId, []);
|
|
675
|
+
pathToNode.push(nodeId.toString());
|
|
676
|
+
// Merge with existing expanded nodes to preserve current expansions
|
|
677
|
+
var mergedExpanded = Array.from(new Set(__spreadArray(__spreadArray([], expanded, true), pathToNode, true)));
|
|
678
|
+
setExpanded(mergedExpanded);
|
|
576
679
|
};
|
|
577
680
|
var handleChange = function (event, nodeIds) {
|
|
578
681
|
var findNode = getNodeData(data, nodeIds !== undefined ? Number.parseInt(nodeIds) : -1);
|
|
@@ -636,6 +739,16 @@ var ModalTreeFilterControl = function (props) {
|
|
|
636
739
|
});
|
|
637
740
|
return treeArray;
|
|
638
741
|
}
|
|
742
|
+
// Helper function to scroll focused item into view
|
|
743
|
+
var scrollFocusedItemIntoView = function (index) {
|
|
744
|
+
var _a;
|
|
745
|
+
if (searchResultsRefs.current[index]) {
|
|
746
|
+
(_a = searchResultsRefs.current[index]) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
747
|
+
behavior: "smooth",
|
|
748
|
+
block: "nearest",
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
};
|
|
639
752
|
// Pre-build search index for better performance with large trees
|
|
640
753
|
var searchIndex = useMemo(function () {
|
|
641
754
|
var index = [];
|
|
@@ -662,11 +775,8 @@ var ModalTreeFilterControl = function (props) {
|
|
|
662
775
|
}
|
|
663
776
|
}
|
|
664
777
|
};
|
|
665
|
-
if (data
|
|
666
|
-
|
|
667
|
-
var child = _a[_i];
|
|
668
|
-
buildIndex(child);
|
|
669
|
-
}
|
|
778
|
+
if (data) {
|
|
779
|
+
buildIndex(data);
|
|
670
780
|
}
|
|
671
781
|
return index;
|
|
672
782
|
}, [data]);
|
|
@@ -693,25 +803,42 @@ var ModalTreeFilterControl = function (props) {
|
|
|
693
803
|
var results = searchNodes(term);
|
|
694
804
|
setSearchResults(results);
|
|
695
805
|
setShowSearchResults(results.length > 0);
|
|
806
|
+
// Auto-focus first result if results are available
|
|
807
|
+
var newFocusIndex = results.length > 0 ? 0 : -1;
|
|
808
|
+
setFocusedSearchIndex(newFocusIndex);
|
|
809
|
+
// Clear refs array and prepare for new results
|
|
810
|
+
searchResultsRefs.current = new Array(results.length).fill(null);
|
|
811
|
+
// Scroll to first item when results appear
|
|
812
|
+
if (newFocusIndex >= 0) {
|
|
813
|
+
setTimeout(function () { return scrollFocusedItemIntoView(newFocusIndex); }, 100);
|
|
814
|
+
}
|
|
696
815
|
}, 250);
|
|
697
816
|
};
|
|
698
817
|
var handleSearchResultClick = function (result) {
|
|
699
|
-
//
|
|
700
|
-
var
|
|
701
|
-
|
|
818
|
+
// Get path to the selected node
|
|
819
|
+
var pathToNode = getNodeParent(data, result.id, []);
|
|
820
|
+
// Merge with existing expanded nodes to avoid collapsing other parts of the tree
|
|
821
|
+
var mergedExpanded = Array.from(new Set(__spreadArray(__spreadArray([], expanded, true), pathToNode, true)));
|
|
822
|
+
setExpanded(mergedExpanded);
|
|
702
823
|
// Select the node
|
|
703
824
|
setValue(result.id);
|
|
704
825
|
// Clear search
|
|
705
826
|
setSearchTerm("");
|
|
706
827
|
setSearchResults([]);
|
|
707
828
|
setShowSearchResults(false);
|
|
708
|
-
|
|
829
|
+
setFocusedSearchIndex(-1);
|
|
830
|
+
if (searchInputRef.current) {
|
|
831
|
+
searchInputRef.current.blur();
|
|
832
|
+
}
|
|
709
833
|
setTimeout(function () {
|
|
710
834
|
var nodeElement = document.getElementById(result.id.toString());
|
|
711
835
|
if (nodeElement) {
|
|
712
|
-
nodeElement.scrollIntoView({
|
|
836
|
+
nodeElement.scrollIntoView({
|
|
837
|
+
behavior: "smooth",
|
|
838
|
+
block: "center",
|
|
839
|
+
});
|
|
713
840
|
}
|
|
714
|
-
},
|
|
841
|
+
}, 300);
|
|
715
842
|
};
|
|
716
843
|
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 },
|
|
717
844
|
nodes.isCode === true && (React__default.createElement(Code, { className: classes.treLabelIcon, htmlColor: "#1ABC9C" })),
|
|
@@ -737,13 +864,21 @@ var ModalTreeFilterControl = function (props) {
|
|
|
737
864
|
justifyContent: "center",
|
|
738
865
|
alignItems: "center",
|
|
739
866
|
} },
|
|
740
|
-
React__default.createElement(LazyLoading, null))) : (React__default.createElement(DialogContent$1, { dividers: true, style: {
|
|
741
|
-
|
|
742
|
-
|
|
867
|
+
React__default.createElement(LazyLoading, null))) : (React__default.createElement(DialogContent$1, { dividers: true, style: {
|
|
868
|
+
height: "500px",
|
|
869
|
+
overflow: "hidden",
|
|
870
|
+
display: "flex",
|
|
871
|
+
flexDirection: "column",
|
|
872
|
+
padding: 0,
|
|
873
|
+
} },
|
|
874
|
+
allowSearch && (React__default.createElement("div", { className: classes.searchContainer, ref: searchContainerRef },
|
|
875
|
+
React__default.createElement(TextField, { className: classes.searchField, placeholder: "Search (min. 2 characters)...", variant: "outlined", size: "small", fullWidth: true, value: searchTerm, onChange: handleSearchChange, inputRef: searchInputRef, InputProps: {
|
|
743
876
|
startAdornment: (React__default.createElement(SearchIcon, { style: { marginRight: 8, color: "#999" } })),
|
|
744
877
|
} }),
|
|
745
878
|
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,
|
|
879
|
+
React__default.createElement(List, null, searchResults.map(function (result, index) { return (React__default.createElement(ListItem, { key: result.id, button: true, ref: function (el) {
|
|
880
|
+
searchResultsRefs.current[index] = el;
|
|
881
|
+
}, className: "".concat(classes.searchResultItem, " ").concat(index === focusedSearchIndex ? "focused" : ""), onClick: function () { return handleSearchResultClick(result); } },
|
|
747
882
|
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
883
|
React__default.createElement(ListItemText, { primary: result.name, secondary: result.path, classes: {
|
|
749
884
|
secondary: classes.searchResultPath,
|
|
@@ -927,8 +1062,8 @@ function getNodePath(node, nodeId, parentPath, isRoot) {
|
|
|
927
1062
|
}
|
|
928
1063
|
var TreePickerControlV2 = function (props) {
|
|
929
1064
|
var classes = useStyles$H();
|
|
930
|
-
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, _e = props.showFullPath, showFullPath = _e === void 0 ? false : _e, showAssetTree = props.showAssetTree, onHide = props.onHide, _f = props.listAssetDrawings, listAssetDrawings = _f === void 0 ? [] : _f, onSuccess = props.onSuccess, isLoading = props.isLoading, _g = props.disabled, disabled = _g === void 0 ? false : _g, _h = props.mostUsedCount, mostUsedCount = _h === void 0 ? 0 : _h, _j = props.itemsWithParent, itemsWithParent = _j === void 0 ? [] : _j, _k = props.dialogMaxWidth, dialogMaxWidth = _k === void 0 ? "sm" : _k, other = __rest(props, ["value", "onSelect", "styleLabel", "dataSource", "getOptionName", "inputTitle", "showPath", "multipleSelectNodes", "showClearButton", "showFullPath", "showAssetTree", "onHide", "listAssetDrawings", "onSuccess", "isLoading", "disabled", "mostUsedCount", "itemsWithParent", "dialogMaxWidth"]);
|
|
931
|
-
var
|
|
1065
|
+
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, _e = props.showFullPath, showFullPath = _e === void 0 ? false : _e, showAssetTree = props.showAssetTree, onHide = props.onHide, _f = props.listAssetDrawings, listAssetDrawings = _f === void 0 ? [] : _f, onSuccess = props.onSuccess, isLoading = props.isLoading, _g = props.disabled, disabled = _g === void 0 ? false : _g, _h = props.mostUsedCount, mostUsedCount = _h === void 0 ? 0 : _h, _j = props.itemsWithParent, itemsWithParent = _j === void 0 ? [] : _j, _k = props.dialogMaxWidth, dialogMaxWidth = _k === void 0 ? "sm" : _k, _l = props.allowSearch, allowSearch = _l === void 0 ? false : _l, other = __rest(props, ["value", "onSelect", "styleLabel", "dataSource", "getOptionName", "inputTitle", "showPath", "multipleSelectNodes", "showClearButton", "showFullPath", "showAssetTree", "onHide", "listAssetDrawings", "onSuccess", "isLoading", "disabled", "mostUsedCount", "itemsWithParent", "dialogMaxWidth", "allowSearch"]);
|
|
1066
|
+
var _m = useState(false), open = _m[0], setOpen = _m[1];
|
|
932
1067
|
var handleClickListItem = function (event) {
|
|
933
1068
|
event.stopPropagation();
|
|
934
1069
|
if (disabled)
|
|
@@ -980,7 +1115,7 @@ var TreePickerControlV2 = function (props) {
|
|
|
980
1115
|
React__default.createElement(Grid, { item: true, xs: 12, md: 12 },
|
|
981
1116
|
React__default.createElement(ModalTreeFilterControl, __assign({ classes: {
|
|
982
1117
|
paper: classes.paper,
|
|
983
|
-
}, 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, mostUsedCount: mostUsedCount, itemsWithParent: itemsWithParent, dialogMaxWidth: dialogMaxWidth }, other)))));
|
|
1118
|
+
}, 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, mostUsedCount: mostUsedCount, itemsWithParent: itemsWithParent, dialogMaxWidth: dialogMaxWidth, allowSearch: allowSearch }, other)))));
|
|
984
1119
|
};
|
|
985
1120
|
|
|
986
1121
|
var SimplePasswordControl = /** @class */ (function (_super) {
|
|
@@ -3125,12 +3260,14 @@ var CodeFilter = function (_a) {
|
|
|
3125
3260
|
};
|
|
3126
3261
|
|
|
3127
3262
|
var DateFilter = function (_a) {
|
|
3128
|
-
var date = _a.date, setDate = _a.setDate, _b = _a.label, label = _b === void 0 ? "Date" : _b;
|
|
3263
|
+
var date = _a.date, setDate = _a.setDate, _b = _a.label, label = _b === void 0 ? "Date" : _b, minDate = _a.minDate, maxDate = _a.maxDate;
|
|
3129
3264
|
var handleDateChange = function (datePicker) {
|
|
3130
|
-
|
|
3265
|
+
if (datePicker) {
|
|
3266
|
+
setDate(datePicker.toDate());
|
|
3267
|
+
}
|
|
3131
3268
|
};
|
|
3132
3269
|
return (React__default.createElement(MuiPickersUtilsProvider, { utils: MomentUtils },
|
|
3133
|
-
React__default.createElement(KeyboardDatePicker, { disableToolbar: true, variant: "inline", format: "MM/DD/yyyy", id: "date-picker-inline", style: {
|
|
3270
|
+
React__default.createElement(KeyboardDatePicker, { disableToolbar: true, variant: "inline", format: "MM/DD/yyyy", id: "date-picker-inline", autoOk: true, minDate: minDate, maxDate: maxDate || moment$3().toDate(), style: {
|
|
3134
3271
|
minWidth: "100%",
|
|
3135
3272
|
borderTopLeftRadius: 3,
|
|
3136
3273
|
borderTopRightRadius: 3,
|
|
@@ -3141,11 +3278,10 @@ var DateFilter = function (_a) {
|
|
|
3141
3278
|
|
|
3142
3279
|
var SearchFilter = function (_a) {
|
|
3143
3280
|
var search = _a.search, setSearch = _a.setSearch;
|
|
3144
|
-
return (React__default.createElement(
|
|
3281
|
+
return (React__default.createElement("div", { style: { marginTop: 8 } },
|
|
3145
3282
|
React__default.createElement(TextField, { style: {
|
|
3146
3283
|
minWidth: "100%",
|
|
3147
|
-
|
|
3148
|
-
}, label: "Search", variant: "outlined", margin: "dense", value: search, onChange: function (e) { return setSearch(e.target.value); }, autoComplete: "off" })));
|
|
3284
|
+
}, label: "Search", variant: "outlined", size: "small", value: search, onChange: function (e) { return setSearch(e.target.value); }, autoComplete: "off" })));
|
|
3149
3285
|
};
|
|
3150
3286
|
|
|
3151
3287
|
var useStyles$B = makeStyles(function (theme) { return ({
|
|
@@ -3160,8 +3296,23 @@ var useStyles$B = makeStyles(function (theme) { return ({
|
|
|
3160
3296
|
}); });
|
|
3161
3297
|
var formatTime = function (nowTime) {
|
|
3162
3298
|
if (nowTime == undefined)
|
|
3163
|
-
return;
|
|
3164
|
-
|
|
3299
|
+
return "";
|
|
3300
|
+
// Ensure nowTime is a Date object
|
|
3301
|
+
var date;
|
|
3302
|
+
if (nowTime instanceof Date) {
|
|
3303
|
+
date = nowTime;
|
|
3304
|
+
}
|
|
3305
|
+
else if (typeof nowTime === "string" || typeof nowTime === "number") {
|
|
3306
|
+
date = new Date(nowTime);
|
|
3307
|
+
}
|
|
3308
|
+
else {
|
|
3309
|
+
return "";
|
|
3310
|
+
}
|
|
3311
|
+
// Check if date is valid
|
|
3312
|
+
if (isNaN(date.getTime())) {
|
|
3313
|
+
return "";
|
|
3314
|
+
}
|
|
3315
|
+
return date.toLocaleDateString() + " " + date.toLocaleTimeString();
|
|
3165
3316
|
};
|
|
3166
3317
|
var ModalLogSelected = function (_a) {
|
|
3167
3318
|
var show = _a.show, onHide = _a.onHide, selectedLog = _a.selectedLog;
|
|
@@ -3171,43 +3322,19 @@ var ModalLogSelected = function (_a) {
|
|
|
3171
3322
|
React__default.createElement(MesfModal.Content, { style: { padding: "15px 30px" } },
|
|
3172
3323
|
React__default.createElement(Grid, { container: true, spacing: 1, alignItems: "flex-start" },
|
|
3173
3324
|
React__default.createElement(Grid, { item: true, md: 6, xs: 12, style: { paddingRight: 20, paddingLeft: 5 } },
|
|
3174
|
-
React__default.createElement(TextField
|
|
3175
|
-
// disabled
|
|
3176
|
-
, {
|
|
3177
|
-
// disabled
|
|
3178
|
-
variant: "standard",
|
|
3179
|
-
// variant="outline"
|
|
3180
|
-
fullWidth: true, margin: "dense", label: "User", defaultValue: selectedLog === null || selectedLog === void 0 ? void 0 : selectedLog.User, InputProps: {
|
|
3325
|
+
React__default.createElement(TextField, { variant: "standard", fullWidth: true, margin: "dense", label: "User", defaultValue: selectedLog === null || selectedLog === void 0 ? void 0 : selectedLog.User, InputProps: {
|
|
3181
3326
|
readOnly: true,
|
|
3182
3327
|
} })),
|
|
3183
3328
|
React__default.createElement(Grid, { item: true, md: 6, xs: 12, style: { paddingRight: 20, paddingLeft: 5 } },
|
|
3184
|
-
React__default.createElement(TextField
|
|
3185
|
-
// disabled
|
|
3186
|
-
, {
|
|
3187
|
-
// disabled
|
|
3188
|
-
variant: "standard",
|
|
3189
|
-
// variant="outline"
|
|
3190
|
-
fullWidth: true, margin: "dense", label: "Time", defaultValue: formatTime(selectedLog === null || selectedLog === void 0 ? void 0 : selectedLog.Timestamp), InputProps: {
|
|
3329
|
+
React__default.createElement(TextField, { variant: "standard", fullWidth: true, margin: "dense", label: "Time", defaultValue: formatTime(selectedLog === null || selectedLog === void 0 ? void 0 : selectedLog.Timestamp), InputProps: {
|
|
3191
3330
|
readOnly: true,
|
|
3192
3331
|
} })),
|
|
3193
3332
|
React__default.createElement(Grid, { item: true, md: 6, xs: 12, style: { paddingRight: 20, paddingLeft: 5 } },
|
|
3194
|
-
React__default.createElement(TextField
|
|
3195
|
-
// disabled
|
|
3196
|
-
, {
|
|
3197
|
-
// disabled
|
|
3198
|
-
variant: "standard",
|
|
3199
|
-
// variant="outline"
|
|
3200
|
-
fullWidth: true, margin: "dense", label: "Source", defaultValue: selectedLog === null || selectedLog === void 0 ? void 0 : selectedLog.Source, InputProps: {
|
|
3333
|
+
React__default.createElement(TextField, { variant: "standard", fullWidth: true, margin: "dense", label: "Source", defaultValue: selectedLog === null || selectedLog === void 0 ? void 0 : selectedLog.Source, InputProps: {
|
|
3201
3334
|
readOnly: true,
|
|
3202
3335
|
} })),
|
|
3203
3336
|
React__default.createElement(Grid, { item: true, md: 6, xs: 12, style: { paddingRight: 20, paddingLeft: 5 } },
|
|
3204
|
-
React__default.createElement(TextField
|
|
3205
|
-
// disabled
|
|
3206
|
-
, {
|
|
3207
|
-
// disabled
|
|
3208
|
-
variant: "standard",
|
|
3209
|
-
// variant="outline"
|
|
3210
|
-
fullWidth: true, margin: "dense", label: "Type", defaultValue: selectedLog === null || selectedLog === void 0 ? void 0 : selectedLog.LogTypeCode, InputProps: {
|
|
3337
|
+
React__default.createElement(TextField, { variant: "standard", fullWidth: true, margin: "dense", label: "Type", defaultValue: selectedLog === null || selectedLog === void 0 ? void 0 : selectedLog.LogTypeCode, InputProps: {
|
|
3211
3338
|
readOnly: true,
|
|
3212
3339
|
} })),
|
|
3213
3340
|
React__default.createElement(Grid, { item: true, md: 12, xs: 12, style: { paddingRight: 20, paddingLeft: 5, marginBottom: 20 } },
|
|
@@ -3326,13 +3453,6 @@ var useLogTableData = function () {
|
|
|
3326
3453
|
return { rows: rows, columnDefs: columnDefs };
|
|
3327
3454
|
};
|
|
3328
3455
|
|
|
3329
|
-
var ButtonWithLoading = function (_a) {
|
|
3330
|
-
var children = _a.children, isLoading = _a.isLoading, props = __rest(_a, ["children", "isLoading"]);
|
|
3331
|
-
return (React__default.createElement(Button, __assign({}, props, { disabled: isLoading }),
|
|
3332
|
-
isLoading && React__default.createElement(CircularProgress, { size: "1rem" }),
|
|
3333
|
-
children));
|
|
3334
|
-
};
|
|
3335
|
-
|
|
3336
3456
|
var useStyles$A = makeStyles(function (theme) { return ({
|
|
3337
3457
|
root: {
|
|
3338
3458
|
"& .MuiDataGrid-row": {
|
|
@@ -3344,49 +3464,12 @@ var useStyles$A = makeStyles(function (theme) { return ({
|
|
|
3344
3464
|
"& .MuiDataGrid-columnHeaderTitle, & .MuiTablePagination-caption": {
|
|
3345
3465
|
fontWeight: "bold",
|
|
3346
3466
|
},
|
|
3347
|
-
// "& .ag-icon-menu": {
|
|
3348
|
-
// display: "none",
|
|
3349
|
-
// },
|
|
3350
|
-
// "& .ag-header-cell-label": {
|
|
3351
|
-
// display: "flex",
|
|
3352
|
-
// alignItems: "start",
|
|
3353
|
-
// justifyContent: "start",
|
|
3354
|
-
// fontSize: "1rem",
|
|
3355
|
-
// fontWeight: "bold",
|
|
3356
|
-
// },
|
|
3357
|
-
// "& .ag-header-cell-centered .ag-header-cell-label": {
|
|
3358
|
-
// justifyContent: "center !important",
|
|
3359
|
-
// },
|
|
3360
|
-
//
|
|
3361
|
-
// "& .ag-header-cell-text": {
|
|
3362
|
-
// textAlign: "start !important",
|
|
3363
|
-
// },
|
|
3364
|
-
//
|
|
3365
|
-
// "& .ag-checkbox-input-wrapper": {
|
|
3366
|
-
// margin: "0 10px",
|
|
3367
|
-
// },
|
|
3368
|
-
// "& .ag-cell": {
|
|
3369
|
-
// padding: "2px !important",
|
|
3370
|
-
// },
|
|
3371
|
-
// "& .ag-header-cell": {
|
|
3372
|
-
// padding: "0px !important",
|
|
3373
|
-
// textAlign: "center !important",
|
|
3374
|
-
// fontSize: 10,
|
|
3375
|
-
// display: "flex",
|
|
3376
|
-
// alignItems: "center",
|
|
3377
|
-
// justifyContent: "center",
|
|
3378
|
-
// },
|
|
3379
|
-
// "& .ag-cell-wrapper": {},
|
|
3380
|
-
// "& .ag-menu-option": {
|
|
3381
|
-
// cursor: "pointer",
|
|
3382
|
-
// },
|
|
3383
3467
|
},
|
|
3384
3468
|
card: {
|
|
3385
|
-
backgroundColor: "#
|
|
3469
|
+
backgroundColor: "#ffffff",
|
|
3386
3470
|
display: "flex",
|
|
3387
3471
|
alignItems: "center",
|
|
3388
3472
|
height: "100%",
|
|
3389
|
-
// justifyContent: "center",
|
|
3390
3473
|
},
|
|
3391
3474
|
filters: {
|
|
3392
3475
|
position: "relative",
|
|
@@ -3458,10 +3541,31 @@ var TableLogs = function (_a) {
|
|
|
3458
3541
|
};
|
|
3459
3542
|
}, []);
|
|
3460
3543
|
var _l = useContextMenuMESF(), showContextMenu = _l.showContextMenu, registerConfig = _l.registerConfig;
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
};
|
|
3544
|
+
// Debounced search timer ref
|
|
3545
|
+
var searchTimeoutRef = useRef(null);
|
|
3546
|
+
// Store current values in ref to avoid closure issues
|
|
3547
|
+
var currentValues = useRef({ Start: Start, End: End, Search: Search, LogTypeCode: LogTypeCode });
|
|
3548
|
+
currentValues.current = { Start: Start, End: End, Search: Search, LogTypeCode: LogTypeCode };
|
|
3549
|
+
// Auto search when Search filter changes (with debounce)
|
|
3550
|
+
useEffect(function () {
|
|
3551
|
+
if (searchTimeoutRef.current) {
|
|
3552
|
+
clearTimeout(searchTimeoutRef.current);
|
|
3553
|
+
}
|
|
3554
|
+
searchTimeoutRef.current = setTimeout(function () {
|
|
3555
|
+
var _a = currentValues.current, currentStart = _a.Start, currentEnd = _a.End, currentSearch = _a.Search, currentLogTypeCode = _a.LogTypeCode;
|
|
3556
|
+
refreshData({
|
|
3557
|
+
Start: currentStart,
|
|
3558
|
+
End: currentEnd,
|
|
3559
|
+
Search: currentSearch,
|
|
3560
|
+
LogTypeCode: currentLogTypeCode,
|
|
3561
|
+
});
|
|
3562
|
+
}, 500);
|
|
3563
|
+
return function () {
|
|
3564
|
+
if (searchTimeoutRef.current) {
|
|
3565
|
+
clearTimeout(searchTimeoutRef.current);
|
|
3566
|
+
}
|
|
3567
|
+
};
|
|
3568
|
+
}, [Search]);
|
|
3465
3569
|
var handleResetButtonClick = function () {
|
|
3466
3570
|
resetFilter();
|
|
3467
3571
|
refreshData({
|
|
@@ -3484,15 +3588,15 @@ var TableLogs = function (_a) {
|
|
|
3484
3588
|
}, [isLoading]);
|
|
3485
3589
|
// Btn reset data
|
|
3486
3590
|
var resetFilter = function () {
|
|
3487
|
-
setStartFilter(
|
|
3488
|
-
setEndFilter(
|
|
3591
|
+
setStartFilter(moment$3().add(-5, "days").hour(0).minute(0).second(0).toDate());
|
|
3592
|
+
setEndFilter(moment$3().hour(23).minute(59).second(59).toDate());
|
|
3489
3593
|
setSearchFilter("");
|
|
3490
3594
|
setLogTypeCodeFilter("A");
|
|
3491
3595
|
setSelectedLog(undefined);
|
|
3492
3596
|
};
|
|
3493
3597
|
var rowClicked = function (rowClickedEvent) {
|
|
3494
3598
|
var data = rowClickedEvent.data;
|
|
3495
|
-
if (data)
|
|
3599
|
+
if (!data)
|
|
3496
3600
|
return;
|
|
3497
3601
|
setSelectedLog(data);
|
|
3498
3602
|
setShowLogModal(true);
|
|
@@ -3527,24 +3631,19 @@ var TableLogs = function (_a) {
|
|
|
3527
3631
|
React.createElement(Grid, { item: true, md: 12, xs: 12 },
|
|
3528
3632
|
React.createElement(Card, { className: classes.card },
|
|
3529
3633
|
React.createElement(CardContent, { style: { padding: "6px !important", width: "100%" } },
|
|
3530
|
-
React.createElement(
|
|
3531
|
-
React.createElement(Grid, {
|
|
3532
|
-
React.createElement(
|
|
3533
|
-
|
|
3534
|
-
React.createElement(
|
|
3535
|
-
|
|
3536
|
-
React.createElement(
|
|
3537
|
-
|
|
3538
|
-
React.createElement(
|
|
3539
|
-
|
|
3540
|
-
React.createElement(
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
React.createElement(Grid, { item: true, md: 4, xs: 12 },
|
|
3544
|
-
React.createElement(ButtonWithLoading, { isLoading: isLoading, fullWidth: true, variant: "contained", color: "primary", type: "submit" }, "Search")))),
|
|
3545
|
-
React.createElement(Grid, { container: true, direction: "row" },
|
|
3546
|
-
React.createElement(Grid, { item: true, md: 12, xs: 12 },
|
|
3547
|
-
React.createElement(SearchFilter, { search: Search, setSearch: setSearchFilter }))))))),
|
|
3634
|
+
React.createElement(Grid, { container: true, alignItems: "center", direction: "row", spacing: 1 },
|
|
3635
|
+
React.createElement(Grid, { item: true, md: 2, xs: 12 },
|
|
3636
|
+
React.createElement(DateFilter, { label: "From", date: Start, setDate: setStartFilter, maxDate: End })),
|
|
3637
|
+
React.createElement(Grid, { item: true, md: 2, xs: 12 },
|
|
3638
|
+
React.createElement(DateFilter, { label: "To", date: End, setDate: setEndFilter, minDate: Start })),
|
|
3639
|
+
React.createElement(Grid, { item: true, md: 1, xs: 12 },
|
|
3640
|
+
React.createElement(CodeFilter, { LogTypeCode: LogTypeCode, setLogTypeCodeFilter: setLogTypeCodeFilter })),
|
|
3641
|
+
React.createElement(Grid, { item: true, md: 2, xs: 12 },
|
|
3642
|
+
React.createElement(TimezoneSelector, { value: Timezone, onChange: setTimezone })),
|
|
3643
|
+
React.createElement(Grid, { item: true, md: 4, xs: 12 },
|
|
3644
|
+
React.createElement(SearchFilter, { search: Search, setSearch: setSearchFilter })),
|
|
3645
|
+
React.createElement(Grid, { item: true, md: 1, xs: 12, style: { paddingTop: 8 } },
|
|
3646
|
+
React.createElement(Button, { variant: "contained", color: "default", onClick: handleResetButtonClick, fullWidth: true, size: "small" }, "Reset")))))),
|
|
3548
3647
|
React.createElement(Grid, { item: true, md: 12, xs: 12, style: {
|
|
3549
3648
|
height: "70vh",
|
|
3550
3649
|
} },
|
|
@@ -11546,6 +11645,13 @@ var ColorPicker = function (_a) {
|
|
|
11546
11645
|
} })); })))));
|
|
11547
11646
|
};
|
|
11548
11647
|
|
|
11648
|
+
var ButtonWithLoading = function (_a) {
|
|
11649
|
+
var children = _a.children, isLoading = _a.isLoading, props = __rest(_a, ["children", "isLoading"]);
|
|
11650
|
+
return (React__default.createElement(Button, __assign({}, props, { disabled: isLoading }),
|
|
11651
|
+
isLoading && React__default.createElement(CircularProgress, { size: "1rem" }),
|
|
11652
|
+
children));
|
|
11653
|
+
};
|
|
11654
|
+
|
|
11549
11655
|
var TrendingsInitialState = {
|
|
11550
11656
|
timeScopeStart: moment$3(new Date()).subtract(1, "days").toDate(),
|
|
11551
11657
|
timeScopeEnd: new Date(),
|
|
@@ -13477,12 +13583,12 @@ var TableComponent = function (_a) {
|
|
|
13477
13583
|
React__default.createElement("td", { className: classes.doubleInput }, round((_c = dataTable[tag.TagName]) === null || _c === void 0 ? void 0 : _c.y2, 3) || 0),
|
|
13478
13584
|
React__default.createElement("td", null, round((_d = dataTable[tag.TagName]) === null || _d === void 0 ? void 0 : _d.y2y1, 3) || 0),
|
|
13479
13585
|
React__default.createElement("td", null,
|
|
13480
|
-
!isNaN(((_e = dataTable[tag.TagName]) === null || _e === void 0 ? void 0 : _e.pmin.y) * 0)
|
|
13586
|
+
!isNaN$1(((_e = dataTable[tag.TagName]) === null || _e === void 0 ? void 0 : _e.pmin.y) * 0)
|
|
13481
13587
|
? round((_f = dataTable[tag.TagName]) === null || _f === void 0 ? void 0 : _f.pmin.y, 3)
|
|
13482
13588
|
: 0,
|
|
13483
13589
|
" "),
|
|
13484
13590
|
React__default.createElement("td", null,
|
|
13485
|
-
!isNaN(((_g = dataTable[tag.TagName]) === null || _g === void 0 ? void 0 : _g.pmax.y) * 0)
|
|
13591
|
+
!isNaN$1(((_g = dataTable[tag.TagName]) === null || _g === void 0 ? void 0 : _g.pmax.y) * 0)
|
|
13486
13592
|
? round((_h = dataTable[tag.TagName]) === null || _h === void 0 ? void 0 : _h.pmax.y)
|
|
13487
13593
|
: 0,
|
|
13488
13594
|
" ")));
|