@dexteel/mesf-core 4.5.0 → 4.5.2
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/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Typography, TextField, makeStyles as makeStyles$1, Button as Button$1, Grid as Grid$1, Dialog as Dialog$1, DialogTitle as DialogTitle$2, DialogContent as DialogContent$2, DialogContentText, DialogActions as DialogActions$2, FormHelperText, CircularProgress as CircularProgress$1, Badge, FormControlLabel, Checkbox, Snackbar as Snackbar$1, Paper as Paper$1, MenuItem as MenuItem$1, useTheme as useTheme$1, Box, FormControl as FormControl$1, Select as Select$1, createStyles as createStyles$1, List, ListItem, ListItemText } from '@material-ui/core';
|
|
1
|
+
import { Typography, TextField, makeStyles as makeStyles$1, Button as Button$1, Grid as Grid$1, Dialog as Dialog$1, DialogTitle as DialogTitle$2, DialogContent as DialogContent$2, DialogContentText, DialogActions as DialogActions$2, FormHelperText, CircularProgress as CircularProgress$1, Badge, FormControlLabel, Checkbox, Snackbar as Snackbar$1, Paper as Paper$1, MenuItem as MenuItem$1, useTheme as useTheme$1, Tooltip, Box, FormControl as FormControl$1, Select as Select$1, createStyles as createStyles$1, List, ListItem, ListItemText } from '@material-ui/core';
|
|
2
2
|
import { values, get, isNil as isNil$1, isEmpty } from 'lodash-es';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useState, useRef, useEffect, Component, createContext, useContext, useMemo, useCallback, lazy, Suspense } from 'react';
|
|
@@ -21,7 +21,7 @@ import { isNil, get as get$1 } from 'lodash';
|
|
|
21
21
|
import { DndProvider } from 'react-dnd';
|
|
22
22
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
23
23
|
import axios from 'axios';
|
|
24
|
-
import { _adapters, Chart, CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, TimeScale } from 'chart.js';
|
|
24
|
+
import { _adapters, Chart, CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip as Tooltip$1, Legend, TimeScale } from 'chart.js';
|
|
25
25
|
import moment from 'moment';
|
|
26
26
|
import zoomPlugin from 'chartjs-plugin-zoom';
|
|
27
27
|
import { Line } from 'react-chartjs-2';
|
|
@@ -8449,30 +8449,29 @@ var TagSelectionModal = function (_a) {
|
|
|
8449
8449
|
React__default.createElement(CircularProgress$1, { size: "2rem" }))) : (React__default.createElement(TreeView$1, { expanded: expanded, onNodeSelect: handleNodeSelect, onNodeToggle: handleNodeToggle }, treeData.map(function (tree) { return renderTree(tree); }))))));
|
|
8450
8450
|
};
|
|
8451
8451
|
|
|
8452
|
+
var useTagsTableStyles = makeStyles$1(function (theme) { return ({
|
|
8453
|
+
checkbox: {
|
|
8454
|
+
'& input[type="checkbox"]': {
|
|
8455
|
+
zoom: 1.5
|
|
8456
|
+
},
|
|
8457
|
+
textAlign: 'center'
|
|
8458
|
+
}
|
|
8459
|
+
}); });
|
|
8460
|
+
|
|
8452
8461
|
var TableComponent = function (_a) {
|
|
8453
8462
|
var tagList = _a.tagList, setTagList = _a.setTagList, cursorData = _a.cursorData, onDeleteTag = _a.onDeleteTag, onAddTag = _a.onAddTag;
|
|
8463
|
+
var classes = useTagsTableStyles();
|
|
8454
8464
|
var handleChange = function (index, value, property) {
|
|
8455
|
-
setTagList(function (prev) {
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
? __assign(__assign({}, tag), (_a = {}, _a[property] = value, _a.autoScale = false, _a)) : tag;
|
|
8460
|
-
});
|
|
8461
|
-
});
|
|
8465
|
+
setTagList(function (prev) { return prev.map(function (tag, currentIndex) {
|
|
8466
|
+
var _a;
|
|
8467
|
+
return currentIndex === index ? __assign(__assign({}, tag), (_a = {}, _a[property] = value, _a.autoScale = false, _a)) : tag;
|
|
8468
|
+
}); });
|
|
8462
8469
|
};
|
|
8463
8470
|
var handleVisibilityChange = function (index, value) {
|
|
8464
|
-
setTagList(function (prev) {
|
|
8465
|
-
return prev.map(function (tag, currentIndex) {
|
|
8466
|
-
return currentIndex === index ? __assign(__assign({}, tag), { visible: value }) : tag;
|
|
8467
|
-
});
|
|
8468
|
-
});
|
|
8471
|
+
setTagList(function (prev) { return prev.map(function (tag, currentIndex) { return currentIndex === index ? __assign(__assign({}, tag), { visible: value }) : tag; }); });
|
|
8469
8472
|
};
|
|
8470
8473
|
var handleAutoScaleChange = function (index, value) {
|
|
8471
|
-
setTagList(function (prev) {
|
|
8472
|
-
return prev.map(function (tag, currentIndex) {
|
|
8473
|
-
return currentIndex === index ? __assign(__assign({}, tag), { autoScale: value }) : tag;
|
|
8474
|
-
});
|
|
8475
|
-
});
|
|
8474
|
+
setTagList(function (prev) { return prev.map(function (tag, currentIndex) { return currentIndex === index ? __assign(__assign({}, tag), { autoScale: value }) : tag; }); });
|
|
8476
8475
|
};
|
|
8477
8476
|
var _b = useState(null), selectedRowIndex = _b[0], setSelectedRowIndex = _b[1];
|
|
8478
8477
|
var _c = useState(false), modalOpen = _c[0], setModalOpen = _c[1];
|
|
@@ -8487,17 +8486,10 @@ var TableComponent = function (_a) {
|
|
|
8487
8486
|
React__default.createElement("ul", null, options.map(function (option) { return (React__default.createElement("li", { key: option.id, onClick: option.onClick }, option.label)); }))));
|
|
8488
8487
|
};
|
|
8489
8488
|
// Position state for the context menu
|
|
8490
|
-
var _d = useState({
|
|
8491
|
-
x: 0,
|
|
8492
|
-
y: 0
|
|
8493
|
-
}), contextMenuPosition = _d[0], setContextMenuPosition = _d[1];
|
|
8489
|
+
var _d = useState({ x: 0, y: 0 }), contextMenuPosition = _d[0], setContextMenuPosition = _d[1];
|
|
8494
8490
|
var contextMenuOptions = [
|
|
8495
|
-
{
|
|
8496
|
-
|
|
8497
|
-
label: "Remove Tag",
|
|
8498
|
-
onClick: function () { return handleDelete(); }
|
|
8499
|
-
},
|
|
8500
|
-
{ id: "add", label: "Add Tag", onClick: function () { return handleTagAdd(); } },
|
|
8491
|
+
{ id: 'delete', label: 'Remove Tag', onClick: function () { return handleDelete(); } },
|
|
8492
|
+
{ id: 'add', label: 'Add Tag', onClick: function () { return handleTagAdd(); } },
|
|
8501
8493
|
// ... other options
|
|
8502
8494
|
];
|
|
8503
8495
|
var handleTagAdd = function () {
|
|
@@ -8543,71 +8535,82 @@ var TableComponent = function (_a) {
|
|
|
8543
8535
|
setSelectedRowIndex(index);
|
|
8544
8536
|
setContextMenuPosition({ x: event.clientX, y: event.clientY });
|
|
8545
8537
|
};
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8588
|
-
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8538
|
+
var headerStyles = {
|
|
8539
|
+
visible: { width: '60px' },
|
|
8540
|
+
color: { width: '70px' },
|
|
8541
|
+
autoScale: { width: '120px' }
|
|
8542
|
+
};
|
|
8543
|
+
var cellStyles = {
|
|
8544
|
+
tagName: {
|
|
8545
|
+
maxWidth: '200px',
|
|
8546
|
+
overflow: 'hidden',
|
|
8547
|
+
textOverflow: 'ellipsis',
|
|
8548
|
+
whiteSpace: 'nowrap'
|
|
8549
|
+
}
|
|
8550
|
+
};
|
|
8551
|
+
return (React__default.createElement(Grid$1, { container: true },
|
|
8552
|
+
React__default.createElement(Grid$1, { item: true, xs: 12 },
|
|
8553
|
+
React__default.createElement("div", { style: { overflowX: 'auto', width: '100%' } },
|
|
8554
|
+
React__default.createElement("table", { style: { width: '80%', tableLayout: 'fixed' } },
|
|
8555
|
+
React__default.createElement("thead", null,
|
|
8556
|
+
React__default.createElement("tr", null,
|
|
8557
|
+
React__default.createElement("th", { style: headerStyles.visible }, "Visible"),
|
|
8558
|
+
React__default.createElement("th", null, "Tag Name"),
|
|
8559
|
+
React__default.createElement("th", { style: headerStyles.color }, "Color"),
|
|
8560
|
+
React__default.createElement("th", null, "Min Scale"),
|
|
8561
|
+
React__default.createElement("th", null, "Max Scale"),
|
|
8562
|
+
React__default.createElement("th", { style: __assign(__assign({}, headerStyles.autoScale), { textAlign: "center" }) }, "AutoScale"),
|
|
8563
|
+
React__default.createElement("th", null, "X"),
|
|
8564
|
+
React__default.createElement("th", null, "Y")))))),
|
|
8565
|
+
React__default.createElement(Grid$1, { item: true, xs: 12 },
|
|
8566
|
+
React__default.createElement("div", { style: { width: '100%', overflowY: 'auto', maxHeight: ' 26svh' } },
|
|
8567
|
+
React__default.createElement("table", { cellPadding: '4px', style: { width: '80%', tableLayout: 'fixed' } },
|
|
8568
|
+
React__default.createElement("tbody", null, tagList.map(function (tag, index) { return (React__default.createElement("tr", { key: tag.tagName, onClick: function () { return handleRowClick(index); }, onContextMenu: function (e) { return handleRightClick(e, index); }, className: selectedRowIndex === index ? "selected-row" : "" },
|
|
8569
|
+
React__default.createElement("td", { style: headerStyles.visible, className: classes.checkbox },
|
|
8570
|
+
React__default.createElement("input", { type: "checkbox", checked: tag.visible, onChange: function (e) { return handleVisibilityChange(index, e.target.checked); } })),
|
|
8571
|
+
React__default.createElement("td", null,
|
|
8572
|
+
React__default.createElement(Tooltip, { title: tag.tagName, placement: "top", arrow: true, interactive: true, enterDelay: 500 },
|
|
8573
|
+
React__default.createElement("div", { style: cellStyles.tagName }, tag.tagName))),
|
|
8574
|
+
React__default.createElement("td", { style: headerStyles.color },
|
|
8575
|
+
React__default.createElement("div", { style: {
|
|
8576
|
+
backgroundColor: tag.color,
|
|
8577
|
+
width: '20px',
|
|
8578
|
+
height: '20px'
|
|
8579
|
+
} })),
|
|
8580
|
+
React__default.createElement("td", null,
|
|
8581
|
+
React__default.createElement("input", { type: "text", style: { width: '100%' }, value: tag.minScale, onFocus: function (e) { return e.target.select(); }, onChange: function (e) {
|
|
8582
|
+
var value = e.target.value;
|
|
8583
|
+
var numericValue = Number(value);
|
|
8584
|
+
// Check if the value is a number and not empty
|
|
8585
|
+
handleChange(index, numericValue, 'minScale');
|
|
8586
|
+
} })),
|
|
8587
|
+
React__default.createElement("td", null,
|
|
8588
|
+
React__default.createElement("input", { type: "text", style: { width: '100%' }, value: tag.maxScale, onFocus: function (e) { return e.target.select(); }, onChange: function (e) {
|
|
8589
|
+
var value = e.target.value;
|
|
8590
|
+
var numericValue = Number(value);
|
|
8591
|
+
// Check if the value is a number and not empty
|
|
8592
|
+
if (!isNaN(numericValue) && value.trim() !== '') {
|
|
8593
|
+
handleChange(index, numericValue, 'maxScale');
|
|
8594
|
+
}
|
|
8595
|
+
} })),
|
|
8596
|
+
React__default.createElement("td", { style: headerStyles.autoScale, className: classes.checkbox },
|
|
8597
|
+
React__default.createElement("input", { type: "checkbox", checked: tag.autoScale, onChange: function (e) { return handleAutoScaleChange(index, e.target.checked); } })),
|
|
8598
|
+
React__default.createElement("td", null, cursorData ? (function () {
|
|
8599
|
+
var date = new Date(cursorData.x);
|
|
8600
|
+
var formattedDate = date.toLocaleString('en-US', {
|
|
8601
|
+
hour12: false,
|
|
8602
|
+
month: 'short',
|
|
8603
|
+
day: 'numeric',
|
|
8604
|
+
hour: '2-digit',
|
|
8605
|
+
minute: '2-digit',
|
|
8606
|
+
second: '2-digit'
|
|
8607
|
+
});
|
|
8608
|
+
var milliseconds = date.getMilliseconds().toString().padStart(3, '0');
|
|
8609
|
+
return "".concat(formattedDate, ".").concat(milliseconds);
|
|
8610
|
+
})() : null),
|
|
8611
|
+
React__default.createElement("td", null, cursorData ? cursorData.values[index] : null))); }))))),
|
|
8609
8612
|
selectedRowIndex !== null && (React__default.createElement(ContextMenu, { x: contextMenuPosition.x, y: contextMenuPosition.y, options: contextMenuOptions })),
|
|
8610
|
-
React__default.createElement(MesfModal, { open: modalOpen, handleClose: handleClose, maxWidth: "lg", "aria-labelledby": "modal-modal-title", "aria-describedby": "modal-modal-description", title:
|
|
8613
|
+
React__default.createElement(MesfModal, { open: modalOpen, handleClose: handleClose, maxWidth: "lg", "aria-labelledby": "modal-modal-title", "aria-describedby": "modal-modal-description", title: 'Tags' },
|
|
8611
8614
|
React__default.createElement(MesfModal.Content, null,
|
|
8612
8615
|
React__default.createElement(Box, null,
|
|
8613
8616
|
React__default.createElement(Typography, { id: "modal-modal-description" },
|
|
@@ -8837,7 +8840,7 @@ var CustomOptionsComponent = function (_a) {
|
|
|
8837
8840
|
"Stepped"))));
|
|
8838
8841
|
};
|
|
8839
8842
|
|
|
8840
|
-
Chart.register(CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, TimeScale, zoomPlugin);
|
|
8843
|
+
Chart.register(CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip$1, Legend, TimeScale, zoomPlugin);
|
|
8841
8844
|
function getVerticalLinePlugin(setCursorData) {
|
|
8842
8845
|
return {
|
|
8843
8846
|
id: "verticalLinePlugin",
|
|
@@ -9202,17 +9205,12 @@ var Trending = function (_a) {
|
|
|
9202
9205
|
React__default.createElement(Grid$1, { item: true, container: true, justifyContent: "flex-end" },
|
|
9203
9206
|
React__default.createElement(Button$1, { variant: "contained", color: "primary" }, "Load View"),
|
|
9204
9207
|
React__default.createElement(Button$1, { variant: "contained", color: "secondary" }, "Save View"))))),
|
|
9205
|
-
React__default.createElement(Grid$1, { item: true, xs: 12, style: { height:
|
|
9206
|
-
React__default.createElement(Paper$1, { style: { height:
|
|
9208
|
+
React__default.createElement(Grid$1, { item: true, xs: 12, style: { height: '45%' } },
|
|
9209
|
+
React__default.createElement(Paper$1, { style: { height: '100%', overflow: 'hidden' } },
|
|
9207
9210
|
React__default.createElement(Line, { data: chartData, options: chartOptions, plugins: [verticalLinePlugin] }))),
|
|
9208
|
-
React__default.createElement(Grid$1, { item: true, xs: 12, style: {
|
|
9209
|
-
height: "40%",
|
|
9210
|
-
display: "flex",
|
|
9211
|
-
justifyContent: "center",
|
|
9212
|
-
flexDirection: "column"
|
|
9213
|
-
} },
|
|
9211
|
+
React__default.createElement(Grid$1, { item: true, xs: 12, style: { height: '40%', minWidth: "100%", paddingTop: "3rem" } },
|
|
9214
9212
|
React__default.createElement(TableComponent, { tagList: tagList, setTagList: setTagList, cursorData: cursorData, onDeleteTag: handleDeleteTag, onAddTag: handleAddTag })),
|
|
9215
|
-
loading && (React__default.createElement(Grid$1, { item: true, xs: 12, style: { textAlign:
|
|
9213
|
+
loading && (React__default.createElement(Grid$1, { item: true, xs: 12, style: { textAlign: 'center' } },
|
|
9216
9214
|
React__default.createElement("p", null, "Loading...")))));
|
|
9217
9215
|
};
|
|
9218
9216
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { CursorData, TagList } from
|
|
3
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CursorData, TagList } from './Trending';
|
|
3
|
+
import './ContextMenu.css';
|
|
4
4
|
interface TableComponentProps {
|
|
5
5
|
tagList: TagList;
|
|
6
6
|
setTagList: React.Dispatch<React.SetStateAction<TagList>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useTagsTableStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"checkbox">;
|