schummar-table 0.10.2 → 0.10.3
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/cjs/index.js +6 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +6 -5
- package/dist/es/index.js.map +1 -1
- package/package.json +5 -5
package/dist/cjs/index.js
CHANGED
|
@@ -1268,17 +1268,18 @@ function ExpandControl({
|
|
|
1268
1268
|
activeItemsById
|
|
1269
1269
|
} = table.getState();
|
|
1270
1270
|
const newExpanded = new Set(expanded);
|
|
1271
|
-
if (expandOnlyOne)
|
|
1271
|
+
if (expandOnlyOne) {
|
|
1272
1272
|
newExpanded.clear();
|
|
1273
|
-
if (isExpanded)
|
|
1274
|
-
newExpanded.delete(itemId);
|
|
1275
|
-
else {
|
|
1276
|
-
newExpanded.add(itemId);
|
|
1277
1273
|
const item = activeItemsById.get(itemId);
|
|
1278
1274
|
for (const ancestor of item ? getAncestors(activeItemsById, item) : []) {
|
|
1279
1275
|
newExpanded.add(ancestor);
|
|
1280
1276
|
}
|
|
1281
1277
|
}
|
|
1278
|
+
if (isExpanded) {
|
|
1279
|
+
newExpanded.delete(itemId);
|
|
1280
|
+
} else {
|
|
1281
|
+
newExpanded.add(itemId);
|
|
1282
|
+
}
|
|
1282
1283
|
onExpandedChange == null ? void 0 : onExpandedChange(newExpanded);
|
|
1283
1284
|
if (!controlledExpanded) {
|
|
1284
1285
|
table.update((state) => {
|