react-magma-dom 4.7.0-next.44 → 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 +13 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/react-magma-dom.cjs.development.js +13 -13
- package/dist/react-magma-dom.cjs.development.js.map +1 -1
- package/dist/react-magma-dom.cjs.production.min.js +1 -1
- package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -15559,7 +15559,7 @@ var getIsDisabled = function getIsDisabled(_ref) {
|
|
|
15559
15559
|
var preselectedItem = preselectedItems == null ? void 0 : preselectedItems.find(function (item) {
|
|
15560
15560
|
return item.itemId === props.itemId;
|
|
15561
15561
|
});
|
|
15562
|
-
var isDisabled = (preselectedItem == null ? void 0 : preselectedItem.isDisabled) !== undefined ? preselectedItem == null ? void 0 : preselectedItem.isDisabled : props.isDisabled;
|
|
15562
|
+
var isDisabled = (preselectedItem == null ? void 0 : preselectedItem.isDisabled) !== undefined ? preselectedItem == null ? void 0 : preselectedItem.isDisabled : props == null ? void 0 : props.isDisabled;
|
|
15563
15563
|
if (selectable === exports.TreeViewSelectable.multi && !checkChildren) {
|
|
15564
15564
|
return isDisabled;
|
|
15565
15565
|
}
|
|
@@ -15612,7 +15612,7 @@ var processItemCheckedStatus = function processItemCheckedStatus(_ref4) {
|
|
|
15612
15612
|
var item = items.find(function (item) {
|
|
15613
15613
|
return item.itemId === itemId;
|
|
15614
15614
|
});
|
|
15615
|
-
if (item.isDisabled && !forceCheckedStatusForDisabled) {
|
|
15615
|
+
if (item != null && item.isDisabled && !forceCheckedStatusForDisabled) {
|
|
15616
15616
|
return items;
|
|
15617
15617
|
}
|
|
15618
15618
|
return items.map(function (item) {
|
|
@@ -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({
|
|
@@ -15897,7 +15897,7 @@ var toggleAllMulti = function toggleAllMulti(_ref19) {
|
|
|
15897
15897
|
checkParents = _ref19.checkParents;
|
|
15898
15898
|
if (!checkChildren) {
|
|
15899
15899
|
return items.map(function (item) {
|
|
15900
|
-
if (item.isDisabled) {
|
|
15900
|
+
if (item != null && item.isDisabled) {
|
|
15901
15901
|
return item;
|
|
15902
15902
|
}
|
|
15903
15903
|
return _extends({}, item, checkedStatus === exports.IndeterminateCheckboxStatus.unchecked ? {} : {
|
|
@@ -15991,17 +15991,17 @@ function useTreeView(props) {
|
|
|
15991
15991
|
}, [items, rawInitialExpandedItems]);
|
|
15992
15992
|
var itemToFocus = React.useMemo(function () {
|
|
15993
15993
|
var enabledItems = items.filter(function (item) {
|
|
15994
|
-
return !item.isDisabled;
|
|
15994
|
+
return !(item != null && item.isDisabled);
|
|
15995
15995
|
});
|
|
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;
|
|
@@ -16042,11 +16042,11 @@ function useTreeView(props) {
|
|
|
16042
16042
|
var itemWithUpdatedDisabledState = itemsWithUpdatedDisabledState.find(function (item) {
|
|
16043
16043
|
return item.itemId === prevItem.itemId;
|
|
16044
16044
|
});
|
|
16045
|
-
if ((itemWithUpdatedDisabledState == null ? void 0 : itemWithUpdatedDisabledState.isDisabled) === prevItem.isDisabled) {
|
|
16045
|
+
if ((itemWithUpdatedDisabledState == null ? void 0 : itemWithUpdatedDisabledState.isDisabled) === (prevItem == null ? void 0 : prevItem.isDisabled)) {
|
|
16046
16046
|
return prevItem;
|
|
16047
16047
|
}
|
|
16048
16048
|
return _extends({}, prevItem, {
|
|
16049
|
-
isDisabled: itemWithUpdatedDisabledState.isDisabled
|
|
16049
|
+
isDisabled: itemWithUpdatedDisabledState == null ? void 0 : itemWithUpdatedDisabledState.isDisabled
|
|
16050
16050
|
});
|
|
16051
16051
|
});
|
|
16052
16052
|
});
|