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
package/dist/esm/index.js
CHANGED
|
@@ -28487,7 +28487,7 @@ var getIsDisabled = function getIsDisabled(_ref) {
|
|
|
28487
28487
|
var preselectedItem = preselectedItems == null ? void 0 : preselectedItems.find(function (item) {
|
|
28488
28488
|
return item.itemId === props.itemId;
|
|
28489
28489
|
});
|
|
28490
|
-
var isDisabled = (preselectedItem == null ? void 0 : preselectedItem.isDisabled) !== undefined ? preselectedItem == null ? void 0 : preselectedItem.isDisabled : props.isDisabled;
|
|
28490
|
+
var isDisabled = (preselectedItem == null ? void 0 : preselectedItem.isDisabled) !== undefined ? preselectedItem == null ? void 0 : preselectedItem.isDisabled : props == null ? void 0 : props.isDisabled;
|
|
28491
28491
|
if (selectable === TreeViewSelectable.multi && !checkChildren) {
|
|
28492
28492
|
return isDisabled;
|
|
28493
28493
|
}
|
|
@@ -28540,7 +28540,7 @@ var processItemCheckedStatus = function processItemCheckedStatus(_ref4) {
|
|
|
28540
28540
|
var item = items.find(function (item) {
|
|
28541
28541
|
return item.itemId === itemId;
|
|
28542
28542
|
});
|
|
28543
|
-
if (item.isDisabled && !forceCheckedStatusForDisabled) {
|
|
28543
|
+
if (item != null && item.isDisabled && !forceCheckedStatusForDisabled) {
|
|
28544
28544
|
return items;
|
|
28545
28545
|
}
|
|
28546
28546
|
return items.map(function (item) {
|
|
@@ -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({
|
|
@@ -28825,7 +28825,7 @@ var toggleAllMulti = function toggleAllMulti(_ref19) {
|
|
|
28825
28825
|
checkParents = _ref19.checkParents;
|
|
28826
28826
|
if (!checkChildren) {
|
|
28827
28827
|
return items.map(function (item) {
|
|
28828
|
-
if (item.isDisabled) {
|
|
28828
|
+
if (item != null && item.isDisabled) {
|
|
28829
28829
|
return item;
|
|
28830
28830
|
}
|
|
28831
28831
|
return _extends({}, item, checkedStatus === IndeterminateCheckboxStatus.unchecked ? {} : {
|
|
@@ -28919,17 +28919,17 @@ function useTreeView(props) {
|
|
|
28919
28919
|
}, [items, rawInitialExpandedItems]);
|
|
28920
28920
|
var itemToFocus = useMemo(function () {
|
|
28921
28921
|
var enabledItems = items.filter(function (item) {
|
|
28922
|
-
return !item.isDisabled;
|
|
28922
|
+
return !(item != null && item.isDisabled);
|
|
28923
28923
|
});
|
|
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;
|
|
@@ -28970,11 +28970,11 @@ function useTreeView(props) {
|
|
|
28970
28970
|
var itemWithUpdatedDisabledState = itemsWithUpdatedDisabledState.find(function (item) {
|
|
28971
28971
|
return item.itemId === prevItem.itemId;
|
|
28972
28972
|
});
|
|
28973
|
-
if ((itemWithUpdatedDisabledState == null ? void 0 : itemWithUpdatedDisabledState.isDisabled) === prevItem.isDisabled) {
|
|
28973
|
+
if ((itemWithUpdatedDisabledState == null ? void 0 : itemWithUpdatedDisabledState.isDisabled) === (prevItem == null ? void 0 : prevItem.isDisabled)) {
|
|
28974
28974
|
return prevItem;
|
|
28975
28975
|
}
|
|
28976
28976
|
return _extends({}, prevItem, {
|
|
28977
|
-
isDisabled: itemWithUpdatedDisabledState.isDisabled
|
|
28977
|
+
isDisabled: itemWithUpdatedDisabledState == null ? void 0 : itemWithUpdatedDisabledState.isDisabled
|
|
28978
28978
|
});
|
|
28979
28979
|
});
|
|
28980
28980
|
});
|