react-magma-dom 4.7.0-next.45 → 4.7.0-next.46

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/esm/index.js CHANGED
@@ -28563,7 +28563,7 @@ var processChildrenSelection = function processChildrenSelection(_ref5) {
28563
28563
  checkedStatus: checkedStatus,
28564
28564
  forceCheckedStatusForDisabled: forceCheckedStatusForDisabled
28565
28565
  });
28566
- if (!item.hasOwnTreeItems) {
28566
+ if (!(item != null && item.hasOwnTreeItems)) {
28567
28567
  return itemsWithProcessedItemCheckedStatus;
28568
28568
  }
28569
28569
  var directChildren = itemsWithProcessedItemCheckedStatus.filter(function (item) {
@@ -28603,7 +28603,7 @@ var getChildrenIds = function getChildrenIds(_ref6) {
28603
28603
  if ((item == null ? void 0 : item.parentId) !== itemId) {
28604
28604
  return result;
28605
28605
  }
28606
- if (item.hasOwnTreeItems) {
28606
+ if (item != null && item.hasOwnTreeItems) {
28607
28607
  return [].concat(result, getChildrenIds({
28608
28608
  items: items,
28609
28609
  itemId: item.itemId
@@ -28631,7 +28631,7 @@ var getChildrenUniqueStatuses = function getChildrenUniqueStatuses(_ref8) {
28631
28631
  itemId: itemId
28632
28632
  });
28633
28633
  var leaves = items.filter(function (item) {
28634
- return !item.hasOwnTreeItems && childrenAndItemIds.includes(item.itemId);
28634
+ return !(item != null && item.hasOwnTreeItems) && childrenAndItemIds.includes(item.itemId);
28635
28635
  });
28636
28636
  var uniqueStatuses = Array.from(new Set(leaves.map(function (item) {
28637
28637
  var _item$checkedStatus;
@@ -28644,7 +28644,7 @@ var getChildrenUniqueStatuses = function getChildrenUniqueStatuses(_ref8) {
28644
28644
  var processInitialParentStatuses = function processInitialParentStatuses(_ref9) {
28645
28645
  var items = _ref9.items;
28646
28646
  var itemsWithSelectedChildren = items.reduce(function (result, item) {
28647
- if (!item.hasOwnTreeItems || item.checkedStatus !== IndeterminateCheckboxStatus.checked) {
28647
+ if (!(item != null && item.hasOwnTreeItems) || (item == null ? void 0 : item.checkedStatus) !== IndeterminateCheckboxStatus.checked) {
28648
28648
  return result;
28649
28649
  }
28650
28650
  return processChildrenSelection({
@@ -28655,7 +28655,7 @@ var processInitialParentStatuses = function processInitialParentStatuses(_ref9)
28655
28655
  });
28656
28656
  }, items);
28657
28657
  return itemsWithSelectedChildren.map(function (item) {
28658
- if (!item.hasOwnTreeItems) {
28658
+ if (!(item != null && item.hasOwnTreeItems)) {
28659
28659
  return item;
28660
28660
  }
28661
28661
  var childrenUniqueStatuses = getChildrenUniqueStatuses({
@@ -28924,12 +28924,12 @@ function useTreeView(props) {
28924
28924
  var firstItem = enabledItems[0];
28925
28925
  if (selectable === TreeViewSelectable.off) {
28926
28926
  var firstExpandableItem = enabledItems.find(function (item) {
28927
- return item.hasOwnTreeItems;
28927
+ return item == null ? void 0 : item.hasOwnTreeItems;
28928
28928
  });
28929
28929
  return firstExpandableItem ? firstExpandableItem.itemId : firstItem == null ? void 0 : firstItem.itemId;
28930
28930
  }
28931
28931
  var firstNonUncheckedItem = enabledItems.find(function (item) {
28932
- return item.checkedStatus && item.checkedStatus !== IndeterminateCheckboxStatus.unchecked;
28932
+ return (item == null ? void 0 : item.checkedStatus) && item.checkedStatus !== IndeterminateCheckboxStatus.unchecked;
28933
28933
  });
28934
28934
  if (firstNonUncheckedItem) {
28935
28935
  return firstNonUncheckedItem.itemId;