@vitrosoftware/common-ui-ts 1.1.171 → 1.1.173

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.js CHANGED
@@ -480,24 +480,34 @@ var ScrollBar = function ScrollBar(props) {
480
480
  var _useState = React.useState(null),
481
481
  element = _useState[0],
482
482
  setElement = _useState[1];
483
- var _useState2 = React.useState(null),
484
- parent = _useState2[0],
485
- setParent = _useState2[1];
486
483
  var ref = React.useRef(null);
487
- var resizeObserver = new window.ResizeObserver(function (entries) {
488
- for (var _iterator = _createForOfIteratorHelperLoose(entries), _step; !(_step = _iterator()).done;) {
489
- var entry = _step.value;
490
- if (parent && entry.target === parent) {
491
- if (parent.offsetHeight && parent.offsetWidth && ref.current) {
492
- ref.current.scrollTop = 1;
493
- ref.current.scrollLeft = 1;
484
+ React.useEffect(function () {
485
+ var checkRendered = function checkRendered() {
486
+ var _ref$current$children, _ref$current$children2;
487
+ if (ref.current && ((_ref$current$children = ref.current.children[0]) === null || _ref$current$children === void 0 ? void 0 : (_ref$current$children2 = _ref$current$children.children) === null || _ref$current$children2 === void 0 ? void 0 : _ref$current$children2.length) > 1) {
488
+ ref.current.scrollTop = 3;
489
+ ref.current.scrollLeft = 3;
490
+ if (ref.current.scrollTop || ref.current.scrollLeft) {
494
491
  ref.current.scrollTop = 0;
495
492
  ref.current.scrollLeft = 0;
496
- resizeObserver.disconnect();
493
+ observer.disconnect();
497
494
  }
498
495
  }
496
+ };
497
+ checkRendered();
498
+ var observer = new MutationObserver(checkRendered);
499
+ if (ref.current && ref.current.children[0]) {
500
+ observer.observe(ref.current.children[0], {
501
+ childList: true,
502
+ subtree: true
503
+ });
499
504
  }
500
- });
505
+ return function () {
506
+ if (ref.current) {
507
+ observer.disconnect();
508
+ }
509
+ };
510
+ }, []);
501
511
  React.useEffect(function () {
502
512
  if (ref.current) {
503
513
  ref.current.addEventListener('ps-scroll-y', onScrollY);
@@ -512,11 +522,6 @@ var ScrollBar = function ScrollBar(props) {
512
522
  }
513
523
  };
514
524
  }, []);
515
- React.useEffect(function () {
516
- if (parent) {
517
- resizeObserver.observe(parent);
518
- }
519
- }, [parent]);
520
525
  var init = function init() {
521
526
  if (w.PerfectScrollbar) {
522
527
  var scrollElement = new w.PerfectScrollbar(ref.current, {
@@ -533,15 +538,12 @@ var ScrollBar = function ScrollBar(props) {
533
538
  }
534
539
  if (props.isFocusOnScroll && ref.current) {
535
540
  ref.current.addEventListener('ps-scroll-y', function () {
536
- return ref.current.click();
541
+ var _ref$current;
542
+ return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.click();
537
543
  });
538
544
  }
539
- updateParent(ref.current);
540
545
  }
541
546
  };
542
- var updateParent = function updateParent(element) {
543
- setParent(element.parentElement);
544
- };
545
547
  var onWheel = function onWheel(e) {
546
548
  e.stopPropagation();
547
549
  };
@@ -20790,9 +20792,6 @@ var TreeView = function TreeView(props) {
20790
20792
  var _useState2 = React.useState(null),
20791
20793
  jsTreeTreeView = _useState2[0],
20792
20794
  setJsTreeTreeView = _useState2[1];
20793
- var _useState3 = React.useState(null),
20794
- scrollableElement = _useState3[0],
20795
- setScrollableElement = _useState3[1];
20796
20795
  var jsTreeRef = React.useRef(null);
20797
20796
  var jsTreeView;
20798
20797
  React.useEffect(function () {
@@ -20839,11 +20838,6 @@ var TreeView = function TreeView(props) {
20839
20838
  });
20840
20839
  }
20841
20840
  }, [jsTreeTreeView]);
20842
- React.useEffect(function () {
20843
- if (scrollableElement && scrollableElement.scrollTop === 0) {
20844
- scrollableElement.scrollTop = 1;
20845
- }
20846
- });
20847
20841
  var onHoverNode = function onHoverNode(treeView, e, obj) {
20848
20842
  var _obj$node$original;
20849
20843
  if ((_obj$node$original = obj.node.original) !== null && _obj$node$original !== void 0 && _obj$node$original.imageHoverUrl) {
@@ -20920,8 +20914,7 @@ var TreeView = function TreeView(props) {
20920
20914
  }
20921
20915
  };
20922
20916
  return React__default.createElement(ScrollBar, {
20923
- className: styles$3['vitro-scrollbar'] + (props.className ? CTRL.SPACE + props.className : CTRL.EMPTY),
20924
- onInit: setScrollableElement
20917
+ className: styles$3['vitro-scrollbar'] + (props.className ? CTRL.SPACE + props.className : CTRL.EMPTY)
20925
20918
  }, React__default.createElement("div", {
20926
20919
  ref: jsTreeRef,
20927
20920
  id: props.id,
@@ -21906,7 +21899,7 @@ var TreeGridTableViewContextImpl = /*#__PURE__*/function () {
21906
21899
  return this.grid.ExpandAll(parent, loaded, levels, max, test, render);
21907
21900
  };
21908
21901
  _proto.correctAllDependencies = function correctAllDependencies() {
21909
- this.grid.ActionCorrectAllDependencies();
21902
+ return this.grid.CorrectAllDependencies();
21910
21903
  };
21911
21904
  _proto.scrollToDate = function scrollToDate(date, align) {
21912
21905
  this.grid.ScrollToDate(date, align);
@@ -21950,6 +21943,9 @@ var TreeGridTableViewContextImpl = /*#__PURE__*/function () {
21950
21943
  _proto.removeCol = function removeCol(col) {
21951
21944
  this.grid.RemoveCol(col);
21952
21945
  };
21946
+ _proto.changeDef = function changeDef(row, def, show, undo) {
21947
+ this.grid.ChangeDef(row, def, show, undo);
21948
+ };
21953
21949
  _createClass(TreeGridTableViewContextImpl, [{
21954
21950
  key: "columnList",
21955
21951
  get: function get() {
@@ -62099,10 +62095,13 @@ var styles$t = {"vitro-view":"_view_vitro-view_1NKb-kU","vitro-tab":"_view_vitro
62099
62095
  var GroupControl = function GroupControl(props) {
62100
62096
  var scrollbarContentRef = React.useRef(null);
62101
62097
  React.useEffect(function () {
62098
+ scrollIntoView();
62099
+ }, [props.item.id]);
62100
+ var scrollIntoView = function scrollIntoView() {
62102
62101
  if (scrollbarContentRef.current) {
62103
62102
  scrollbarContentRef.current.scrollIntoView();
62104
62103
  }
62105
- }, [props.componentList]);
62104
+ };
62106
62105
  return React__default.createElement(ControlGroup, {
62107
62106
  horizontal: true
62108
62107
  }, React__default.createElement(ScrollBar, {
@@ -63546,7 +63545,7 @@ var Viewer = function Viewer(props) {
63546
63545
  };
63547
63546
 
63548
63547
  var name = "@vitrosoftware/common-ui-ts";
63549
- var version$1 = "1.1.171";
63548
+ var version$1 = "1.1.173";
63550
63549
  var description = "vitro software common ui ts";
63551
63550
  var author = "";
63552
63551
  var license = "MIT";
@@ -67358,8 +67357,8 @@ var Item$3 = function Item(props) {
67358
67357
  props.onChange(val, componentProps.name);
67359
67358
  }
67360
67359
  };
67361
- var onControlChange = function onControlChange(val, name) {
67362
- value.valueList = Array.isArray(val) ? val : [val];
67360
+ var onControlChange = function onControlChange(val) {
67361
+ value.valueList = val !== null && val !== undefined ? Array.isArray(val) ? val : [val] : [];
67363
67362
  onChange(value);
67364
67363
  };
67365
67364
  return React__default.createElement(FlexBox, {