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.
@@ -15635,7 +15635,7 @@ var processChildrenSelection = function processChildrenSelection(_ref5) {
15635
15635
  checkedStatus: checkedStatus,
15636
15636
  forceCheckedStatusForDisabled: forceCheckedStatusForDisabled
15637
15637
  });
15638
- if (!item.hasOwnTreeItems) {
15638
+ if (!(item != null && item.hasOwnTreeItems)) {
15639
15639
  return itemsWithProcessedItemCheckedStatus;
15640
15640
  }
15641
15641
  var directChildren = itemsWithProcessedItemCheckedStatus.filter(function (item) {
@@ -15675,7 +15675,7 @@ var getChildrenIds = function getChildrenIds(_ref6) {
15675
15675
  if ((item == null ? void 0 : item.parentId) !== itemId) {
15676
15676
  return result;
15677
15677
  }
15678
- if (item.hasOwnTreeItems) {
15678
+ if (item != null && item.hasOwnTreeItems) {
15679
15679
  return [].concat(result, getChildrenIds({
15680
15680
  items: items,
15681
15681
  itemId: item.itemId
@@ -15703,7 +15703,7 @@ var getChildrenUniqueStatuses = function getChildrenUniqueStatuses(_ref8) {
15703
15703
  itemId: itemId
15704
15704
  });
15705
15705
  var leaves = items.filter(function (item) {
15706
- return !item.hasOwnTreeItems && childrenAndItemIds.includes(item.itemId);
15706
+ return !(item != null && item.hasOwnTreeItems) && childrenAndItemIds.includes(item.itemId);
15707
15707
  });
15708
15708
  var uniqueStatuses = Array.from(new Set(leaves.map(function (item) {
15709
15709
  var _item$checkedStatus;
@@ -15716,7 +15716,7 @@ var getChildrenUniqueStatuses = function getChildrenUniqueStatuses(_ref8) {
15716
15716
  var processInitialParentStatuses = function processInitialParentStatuses(_ref9) {
15717
15717
  var items = _ref9.items;
15718
15718
  var itemsWithSelectedChildren = items.reduce(function (result, item) {
15719
- if (!item.hasOwnTreeItems || item.checkedStatus !== exports.IndeterminateCheckboxStatus.checked) {
15719
+ if (!(item != null && item.hasOwnTreeItems) || (item == null ? void 0 : item.checkedStatus) !== exports.IndeterminateCheckboxStatus.checked) {
15720
15720
  return result;
15721
15721
  }
15722
15722
  return processChildrenSelection({
@@ -15727,7 +15727,7 @@ var processInitialParentStatuses = function processInitialParentStatuses(_ref9)
15727
15727
  });
15728
15728
  }, items);
15729
15729
  return itemsWithSelectedChildren.map(function (item) {
15730
- if (!item.hasOwnTreeItems) {
15730
+ if (!(item != null && item.hasOwnTreeItems)) {
15731
15731
  return item;
15732
15732
  }
15733
15733
  var childrenUniqueStatuses = getChildrenUniqueStatuses({
@@ -15996,12 +15996,12 @@ function useTreeView(props) {
15996
15996
  var firstItem = enabledItems[0];
15997
15997
  if (selectable === exports.TreeViewSelectable.off) {
15998
15998
  var firstExpandableItem = enabledItems.find(function (item) {
15999
- return item.hasOwnTreeItems;
15999
+ return item == null ? void 0 : item.hasOwnTreeItems;
16000
16000
  });
16001
16001
  return firstExpandableItem ? firstExpandableItem.itemId : firstItem == null ? void 0 : firstItem.itemId;
16002
16002
  }
16003
16003
  var firstNonUncheckedItem = enabledItems.find(function (item) {
16004
- return item.checkedStatus && item.checkedStatus !== exports.IndeterminateCheckboxStatus.unchecked;
16004
+ return (item == null ? void 0 : item.checkedStatus) && item.checkedStatus !== exports.IndeterminateCheckboxStatus.unchecked;
16005
16005
  });
16006
16006
  if (firstNonUncheckedItem) {
16007
16007
  return firstNonUncheckedItem.itemId;