@gridsuite/commons-ui 0.27.0 → 0.27.1
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.
|
@@ -221,16 +221,21 @@ var TreeViewFinder = function TreeViewFinder(props) {
|
|
|
221
221
|
}, node.name));
|
|
222
222
|
};
|
|
223
223
|
|
|
224
|
+
var showChevron = function showChevron(node) {
|
|
225
|
+
// by defaut show Chevron if childrenCount is null or undefined otherwise only if > 0
|
|
226
|
+
return !!(node.childrenCount == null || node.childrenCount && node.childrenCount > 0);
|
|
227
|
+
};
|
|
228
|
+
|
|
224
229
|
var renderTree = function renderTree(node) {
|
|
225
230
|
if (!node) return;
|
|
226
231
|
return /*#__PURE__*/_react["default"].createElement(_TreeItem["default"], {
|
|
227
232
|
key: node.id,
|
|
228
233
|
nodeId: node.id,
|
|
229
234
|
label: renderTreeItemLabel(node),
|
|
230
|
-
expandIcon: node
|
|
235
|
+
expandIcon: showChevron(node) ? /*#__PURE__*/_react["default"].createElement(_ChevronRight["default"], {
|
|
231
236
|
className: classes.icon
|
|
232
237
|
}) : null,
|
|
233
|
-
collapseIcon: node
|
|
238
|
+
collapseIcon: showChevron(node) ? /*#__PURE__*/_react["default"].createElement(_ExpandMore["default"], {
|
|
234
239
|
className: classes.icon
|
|
235
240
|
}) : null
|
|
236
241
|
}, Array.isArray(node.children) ? node.children.length ? node.children.sort(sortMethod).map(function (child) {
|