@dexteel/mesf-core 4.7.6 → 4.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/index.esm.js +33 -56
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
|
+
## 4.7.7
|
|
3
|
+
- Trendings: Scales now admits negative numbers
|
|
4
|
+
- Trendings: Fix saveTagDefaults bug. When you save the default to Tag, you also save the View Tag selected.
|
|
5
|
+
## 4.7.6
|
|
6
|
+
- Remove margin in configurations page
|
|
2
7
|
## 4.7.5
|
|
3
8
|
- Added function to format AssetFullPath and display a part in the input
|
|
4
9
|
## 4.7.4
|
package/dist/index.esm.js
CHANGED
|
@@ -10050,7 +10050,7 @@ var TagSelectionModal = function (_a) {
|
|
|
10050
10050
|
tag: {
|
|
10051
10051
|
TagId: dbTag.tagId,
|
|
10052
10052
|
TagName: dbTag.tagName,
|
|
10053
|
-
Color: getColor(),
|
|
10053
|
+
Color: dbTag.color || getColor(),
|
|
10054
10054
|
IsAutoScale: true,
|
|
10055
10055
|
MinScale: dbTag.minScale,
|
|
10056
10056
|
MaxScale: dbTag.maxScale,
|
|
@@ -10641,7 +10641,6 @@ var TableComponent = function (_a) {
|
|
|
10641
10641
|
var _b = useTrendingContext(), _c = _b.state, viewTags = _c.viewTags, viewSelected = _c.viewSelected, _d = _b.actions, setViewTags = _d.setViewTags, setGraphShouldUpdate = _d.setGraphShouldUpdate;
|
|
10642
10642
|
var _e = useState(''), error = _e[0], setError = _e[1];
|
|
10643
10643
|
var dataTable = useTagsDataTable({ viewTags: viewTags, chartData: chartData, cursorData: cursorData });
|
|
10644
|
-
var _f = useState({}), editableTagNames = _f[0], setEditableTagNames = _f[1];
|
|
10645
10644
|
var handleChange = function (tagId, value, property) {
|
|
10646
10645
|
var newTags = viewTags.map(function (tag) {
|
|
10647
10646
|
var _a;
|
|
@@ -10686,11 +10685,11 @@ var TableComponent = function (_a) {
|
|
|
10686
10685
|
handleAutoScaleChange(tagId, checked);
|
|
10687
10686
|
}
|
|
10688
10687
|
};
|
|
10689
|
-
var
|
|
10690
|
-
var
|
|
10691
|
-
var
|
|
10692
|
-
var
|
|
10693
|
-
var
|
|
10688
|
+
var _f = useState(null), selectedRowIndex = _f[0], setSelectedRowIndex = _f[1];
|
|
10689
|
+
var _g = useState(false), addTagModalOpen = _g[0], setAddTagModalOpen = _g[1];
|
|
10690
|
+
var _h = useState(false), saveViewModalOpen = _h[0], setSaveViewModalOpen = _h[1];
|
|
10691
|
+
var _j = useState(false), saveAsViewModalOpen = _j[0], setSaveAsViewModalOpen = _j[1];
|
|
10692
|
+
var _k = useState(false), loadViewOpen = _k[0], setLoadViewOpen = _k[1];
|
|
10694
10693
|
var handleClose = function () { return setAddTagModalOpen(false); };
|
|
10695
10694
|
var ContextMenu = function (_a) {
|
|
10696
10695
|
var x = _a.x, y = _a.y, options = _a.options;
|
|
@@ -10701,7 +10700,7 @@ var TableComponent = function (_a) {
|
|
|
10701
10700
|
React__default.createElement("ul", null, options.map(function (option) { return (React__default.createElement("li", { key: option.id, onClick: option.onClick }, option.label)); }))));
|
|
10702
10701
|
};
|
|
10703
10702
|
// Position state for the context menu
|
|
10704
|
-
var
|
|
10703
|
+
var _l = useState({ x: 0, y: 0 }), contextMenuPosition = _l[0], setContextMenuPosition = _l[1];
|
|
10705
10704
|
var contextMenuOptions = [
|
|
10706
10705
|
{ id: 'delete', label: 'Remove Tag', onClick: function () { return handleDelete(); } },
|
|
10707
10706
|
{ id: 'add', label: 'Add Tag', onClick: function () { return setAddTagModalOpen(true); } },
|
|
@@ -10738,14 +10737,6 @@ var TableComponent = function (_a) {
|
|
|
10738
10737
|
}
|
|
10739
10738
|
});
|
|
10740
10739
|
}); };
|
|
10741
|
-
useEffect(function () {
|
|
10742
|
-
if (Array.isArray(viewTags)) {
|
|
10743
|
-
setEditableTagNames(viewTags.reduce(function (acc, tag) {
|
|
10744
|
-
acc[tag.TagId] = tag.Alias || tag.TagName;
|
|
10745
|
-
return acc;
|
|
10746
|
-
}, {}));
|
|
10747
|
-
}
|
|
10748
|
-
}, [viewTags]);
|
|
10749
10740
|
useEffect(function () {
|
|
10750
10741
|
var handleGlobalClick = function (e) {
|
|
10751
10742
|
if (selectedRowIndex !== null) {
|
|
@@ -10773,39 +10764,27 @@ var TableComponent = function (_a) {
|
|
|
10773
10764
|
setContextMenuPosition({ x: event.clientX, y: event.clientY });
|
|
10774
10765
|
};
|
|
10775
10766
|
var handleSaveDefaultToTag = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
10776
|
-
var
|
|
10777
|
-
return __generator(this, function (
|
|
10778
|
-
switch (
|
|
10767
|
+
var _a, TagId, Alias, Color, MinScale, MaxScale, Unit, IsVisible, IsAutoScale, saveTagDefaultsResp, upsertViewTagResp;
|
|
10768
|
+
return __generator(this, function (_b) {
|
|
10769
|
+
switch (_b.label) {
|
|
10779
10770
|
case 0:
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
return __generator(this, function (_a) {
|
|
10784
|
-
switch (_a.label) {
|
|
10785
|
-
case 0: return [4 /*yield*/, saveTagDefaults(vt.TagId, vt.Alias, vt.Color, vt.MinScale, vt.MaxScale, vt.Unit)];
|
|
10786
|
-
case 1:
|
|
10787
|
-
response = _a.sent();
|
|
10788
|
-
return [2 /*return*/, response];
|
|
10789
|
-
}
|
|
10790
|
-
});
|
|
10791
|
-
}); });
|
|
10792
|
-
return [4 /*yield*/, Promise.all(promises)];
|
|
10771
|
+
if (!(viewSelected && selectedRowIndex !== null)) return [3 /*break*/, 3];
|
|
10772
|
+
_a = viewTags[selectedRowIndex], TagId = _a.TagId, Alias = _a.Alias, Color = _a.Color, MinScale = _a.MinScale, MaxScale = _a.MaxScale, Unit = _a.Unit, IsVisible = _a.IsVisible, IsAutoScale = _a.IsAutoScale;
|
|
10773
|
+
return [4 /*yield*/, saveTagDefaults(TagId, Alias, Color, MinScale, MaxScale, Unit)];
|
|
10793
10774
|
case 1:
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
if (!r.ok) {
|
|
10797
|
-
setError(r.message);
|
|
10798
|
-
}
|
|
10799
|
-
});
|
|
10800
|
-
return [3 /*break*/, 4];
|
|
10775
|
+
saveTagDefaultsResp = _b.sent();
|
|
10776
|
+
return [4 /*yield*/, upsertViewTag(viewSelected === null || viewSelected === void 0 ? void 0 : viewSelected.ViewId, TagId, Color, MinScale, MaxScale, IsVisible, IsAutoScale)];
|
|
10801
10777
|
case 2:
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10778
|
+
upsertViewTagResp = _b.sent();
|
|
10779
|
+
if (!saveTagDefaultsResp.ok) {
|
|
10780
|
+
setError(saveTagDefaultsResp.message);
|
|
10781
|
+
}
|
|
10782
|
+
if (!upsertViewTagResp.ok) {
|
|
10783
|
+
setError(upsertViewTagResp.message);
|
|
10784
|
+
}
|
|
10806
10785
|
setSelectedRowIndex(null);
|
|
10807
|
-
|
|
10808
|
-
case
|
|
10786
|
+
_b.label = 3;
|
|
10787
|
+
case 3: return [2 /*return*/];
|
|
10809
10788
|
}
|
|
10810
10789
|
});
|
|
10811
10790
|
}); };
|
|
@@ -10895,35 +10874,33 @@ var TableComponent = function (_a) {
|
|
|
10895
10874
|
React__default.createElement("td", { className: classes.inputCol },
|
|
10896
10875
|
React__default.createElement(Tooltip, { title: tag.TagName, placement: "top", arrow: true, interactive: true, enterDelay: 500 },
|
|
10897
10876
|
React__default.createElement("div", null,
|
|
10898
|
-
React__default.createElement("input", { type: "text", style: { width: '100%' }, value:
|
|
10899
|
-
var
|
|
10900
|
-
|
|
10901
|
-
}, onKeyDown: function (e) {
|
|
10902
|
-
if (e.key === 'Enter') {
|
|
10903
|
-
handleChangeAlias(tag.TagId, editableTagNames[tag.TagId]);
|
|
10904
|
-
}
|
|
10877
|
+
React__default.createElement("input", { type: "text", style: { width: '100%' }, value: tag.Alias || tag.TagName, onFocus: function (e) { return e.target.select(); }, onChange: function (e) {
|
|
10878
|
+
var newAlias = e.target.value;
|
|
10879
|
+
handleChangeAlias(tag.TagId, newAlias);
|
|
10905
10880
|
} })))),
|
|
10906
10881
|
React__default.createElement("td", { className: classes.color },
|
|
10907
10882
|
React__default.createElement(ColorPicker, { onChange: handleColorChange, color: tag.Color, elementId: tag.TagId })),
|
|
10908
10883
|
React__default.createElement("td", { className: classes.inputCol },
|
|
10909
|
-
React__default.createElement("input", { type: "
|
|
10884
|
+
React__default.createElement("input", { type: "number", style: __assign({ width: '100%' }, (tag.IsAutoScale ? {
|
|
10910
10885
|
backgroundColor: 'rgba(239, 239, 239, 0.3)',
|
|
10911
10886
|
color: 'rgba(84, 84, 84, 1)',
|
|
10912
10887
|
border: '1px solid rgba(118, 118, 118, 0.3)'
|
|
10913
10888
|
} : {})), value: tag.MinScale, onClick: function () { return handleAbleScales(tag.TagId, tag.IsAutoScale); }, onFocus: function (e) { return e.target.select(); }, onChange: function (e) {
|
|
10914
10889
|
var value = e.target.value;
|
|
10915
10890
|
var numericValue = Number(value);
|
|
10916
|
-
|
|
10891
|
+
if (!isNaN(numericValue) && value.trim() !== '') {
|
|
10892
|
+
handleChange(tag.TagId, numericValue, 'MinScale');
|
|
10893
|
+
}
|
|
10917
10894
|
} })),
|
|
10918
10895
|
React__default.createElement("td", { className: classes.inputCol },
|
|
10919
|
-
React__default.createElement("input", { type: "
|
|
10896
|
+
React__default.createElement("input", { type: "number" // Cambiado de text a number para una mejor validación de entrada
|
|
10897
|
+
, style: __assign({ width: '100%' }, (tag.IsAutoScale ? {
|
|
10920
10898
|
backgroundColor: 'rgba(239, 239, 239, 0.3)',
|
|
10921
10899
|
color: 'rgba(84, 84, 84, 1)',
|
|
10922
10900
|
border: '1px solid rgba(118, 118, 118, 0.3)'
|
|
10923
10901
|
} : {})), value: tag.MaxScale, onClick: function () { return handleAbleScales(tag.TagId, tag.IsAutoScale); }, onFocus: function (e) { return e.target.select(); }, onChange: function (e) {
|
|
10924
10902
|
var value = e.target.value;
|
|
10925
10903
|
var numericValue = Number(value);
|
|
10926
|
-
// Check if the value is a number and not empty
|
|
10927
10904
|
if (!isNaN(numericValue) && value.trim() !== '') {
|
|
10928
10905
|
handleChange(tag.TagId, numericValue, 'MaxScale');
|
|
10929
10906
|
}
|