@dexteel/mesf-core 3.10.1 → 3.10.3

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 CHANGED
@@ -1,4 +1,8 @@
1
1
  # CHANGELOG
2
+ ## 3.10.2
3
+ - Fix TreePicker Control: don't close on select and restrict visualization based on selected node
4
+ ## 3.10.1
5
+ - Add UTLSettings
2
6
  ## 3.9.2
3
7
  - Area selector fixed
4
8
  ## 3.9.1
@@ -1,5 +1,5 @@
1
- import React from "react";
2
1
  import PropTypes from 'prop-types';
2
+ import React from "react";
3
3
  declare const ModalTreeFilterControl: {
4
4
  (props: any): React.JSX.Element;
5
5
  propTypes: {
package/dist/index.esm.js CHANGED
@@ -51,12 +51,12 @@ import IconButton from '@material-ui/core/IconButton';
51
51
  import CloseIcon from '@material-ui/icons/Close';
52
52
  import PropTypes from 'prop-types';
53
53
  import { ResponsiveBar } from '@nivo/bar';
54
- import TreeView from '@material-ui/lab/TreeView';
55
- import SvgIcon from '@material-ui/core/SvgIcon';
56
- import TreeItem from '@material-ui/lab/TreeItem';
57
54
  import Collapse from '@material-ui/core/Collapse';
55
+ import SvgIcon from '@material-ui/core/SvgIcon';
58
56
  import Code from '@material-ui/icons/Code';
59
57
  import Folder from '@material-ui/icons/Folder';
58
+ import TreeItem from '@material-ui/lab/TreeItem';
59
+ import TreeView from '@material-ui/lab/TreeView';
60
60
  import { useSpring, animated } from 'react-spring';
61
61
  import CardActions from '@material-ui/core/CardActions';
62
62
 
@@ -323,20 +323,7 @@ var ModalTreeFilterControl = function (props) {
323
323
  if (valueProp !== undefined)
324
324
  expandNode(valueProp);
325
325
  }
326
- }, [valueProp, open]); // eslint-disable-line react-hooks/exhaustive-deps
327
- useEffect(function () {
328
- if (open) {
329
- var findNode = getNodeData(data, parseInt(value));
330
- if (findNode === null)
331
- findNode = {};
332
- var activeFilter = (selectActive && findNode.isActive) || selectActive !== true;
333
- var internalFilter = (selectInternal && findNode.isInternal) || selectInternal !== true;
334
- if (findNode.isLeaf) {
335
- if (activeFilter && internalFilter)
336
- onClose(value, findNode.name, findNode);
337
- }
338
- }
339
- }, [value]); // eslint-disable-line react-hooks/exhaustive-deps
326
+ }, [valueProp, open]);
340
327
  var handleEntering = function () {
341
328
  if (treeRef.current != null) {
342
329
  treeRef.current.focus();
@@ -361,6 +348,26 @@ var ModalTreeFilterControl = function (props) {
361
348
  onClose(value, findNode.name, findNode);
362
349
  }
363
350
  };
351
+ var getNodeParent = function (node, id, chain) {
352
+ if (chain === void 0) { chain = []; }
353
+ if (!node || node.id === undefined) {
354
+ return [];
355
+ }
356
+ if (node.id === id) {
357
+ chain.push(node.id.toString());
358
+ return chain;
359
+ }
360
+ if (Array.isArray(node.children)) {
361
+ chain.push(node.id.toString());
362
+ for (var i = 0; i < node.children.length; i++) {
363
+ var result = getNodeParent(node.children[i], id, chain.slice());
364
+ if (result.length > 0) {
365
+ return result;
366
+ }
367
+ }
368
+ }
369
+ return [];
370
+ };
364
371
  var expandNode = function (node, same) {
365
372
  var expandedNode = getNodeParent(data, node, []);
366
373
  expandedNode.push(node.toString());
@@ -400,22 +407,6 @@ var ModalTreeFilterControl = function (props) {
400
407
  nodes.isCode &&
401
408
  React__default.createElement("i", { className: "fas fa-square mr-2", style: { "color": (nodes.delayCategoryColor || '#FFFFFF') } }),
402
409
  nodes.name))), className: "delay-item-node", id: nodes.id, "data-isbranch": !nodes.isCode }, Array.isArray(nodes.children) ? nodes.children.map(function (node) { return renderTree(node); }) : null)); };
403
- var getNodeParent = function (node, id, chain) {
404
- if (id === undefined)
405
- return [];
406
- if (node.id.toString() === id.toString())
407
- return chain;
408
- if (Array.isArray(node.children)) {
409
- var i;
410
- var result = null;
411
- chain.push(node.id.toString());
412
- for (i = 0; result == null && i < node.children.length; i++) {
413
- result = getNodeParent(node.children[i], id, chain);
414
- }
415
- return result;
416
- }
417
- return null;
418
- };
419
410
  return (React__default.createElement(Dialog, __assign({ onClose: function (event, reason) { return null; }, "aria-label": title, maxWidth: "xs", TransitionProps: { onEntering: handleEntering }, "aria-labelledby": "confirmation-dialog-title", open: open }, other),
420
411
  React__default.createElement(DialogTitle$1, { id: "confirmation-dialog-title" }, title),
421
412
  React__default.createElement(DialogContent$1, { dividers: true },
@@ -5714,19 +5705,13 @@ function Login(_a) {
5714
5705
  }
5715
5706
 
5716
5707
  function Logout() {
5717
- var _this = this;
5718
5708
  var clearUserData = useContext(AuthContext).clearUserData;
5719
5709
  var navigate = useNavigate();
5720
5710
  var _a = useSearchParams(), params = _a[0]; _a[1];
5721
- var setUserLogged = useUserContext().actions.setUserLogged;
5722
- var logout = function () { return __awaiter(_this, void 0, void 0, function () {
5723
- return __generator(this, function (_a) {
5724
- setUserLogged(false);
5725
- clearUserData();
5726
- navigate("/?".concat(params.toString()));
5727
- return [2 /*return*/];
5728
- });
5729
- }); };
5711
+ var logout = function () {
5712
+ clearUserData();
5713
+ navigate("/?".concat(params.toString()));
5714
+ };
5730
5715
  useEffect(function () {
5731
5716
  logout();
5732
5717
  }, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dexteel/mesf-core",
3
- "version": "3.10.1",
3
+ "version": "3.10.3",
4
4
  "author": "Dexteel Team",
5
5
  "module": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",