@aivenio/aquarium 1.80.1 → 2.0.0
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/atoms.cjs +6 -3
- package/dist/atoms.mjs +6 -3
- package/dist/src/atoms/DataList/DataList.d.ts +1 -0
- package/dist/src/atoms/DataList/DataList.js +4 -3
- package/dist/src/molecules/DataList/DataList.d.ts +11 -11
- package/dist/src/molecules/DataList/DataList.js +41 -21
- package/dist/src/molecules/DataList/DataListComponents.d.ts +8 -1
- package/dist/src/molecules/DataList/DataListComponents.js +13 -5
- package/dist/src/molecules/DataList/DataListGroup.d.ts +5 -4
- package/dist/src/molecules/DataList/DataListGroup.js +24 -20
- package/dist/src/molecules/DataList/DataListSkeleton.js +2 -2
- package/dist/styles.css +8 -4
- package/dist/system.cjs +123 -56
- package/dist/system.mjs +123 -56
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -11285,7 +11285,7 @@ var Cell = (_a) => {
|
|
11285
11285
|
cellClassNames,
|
11286
11286
|
getBodyCellClassNames(false, stickyColumn),
|
11287
11287
|
getAlignClassNames2(align),
|
11288
|
-
tw("border-default
|
11288
|
+
tw("border-default"),
|
11289
11289
|
className
|
11290
11290
|
)
|
11291
11291
|
}));
|
@@ -11296,18 +11296,21 @@ var Row = (_a) => {
|
|
11296
11296
|
disabled,
|
11297
11297
|
header,
|
11298
11298
|
subgroup,
|
11299
|
-
active
|
11299
|
+
active,
|
11300
|
+
isLast
|
11300
11301
|
} = _b, rest = __objRest(_b, [
|
11301
11302
|
"className",
|
11302
11303
|
"disabled",
|
11303
11304
|
"header",
|
11304
11305
|
"subgroup",
|
11305
|
-
"active"
|
11306
|
+
"active",
|
11307
|
+
"isLast"
|
11306
11308
|
]);
|
11307
11309
|
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, rest), {
|
11308
11310
|
role: subgroup ? "rowgroup" : "row"
|
11309
11311
|
}), { inert: disabled ? "" : void 0 }), {
|
11310
11312
|
className: classNames(tw("contents"), className, {
|
11313
|
+
"[&>*]:border-b-transparent": isLast,
|
11311
11314
|
"children:opacity-70": disabled,
|
11312
11315
|
"[&>*]:bg-primary-active": active,
|
11313
11316
|
"[&>*]:hover:bg-muted": !disabled && !header
|
@@ -12013,19 +12016,32 @@ var DataListRow = ({
|
|
12013
12016
|
menu,
|
12014
12017
|
active,
|
12015
12018
|
disabled,
|
12019
|
+
isLast,
|
12020
|
+
selectionDisabled,
|
12016
12021
|
rowClassName,
|
12017
12022
|
renderFirstColumn,
|
12018
12023
|
additionalRowProps = () => ({}),
|
12019
12024
|
additionalColumnProps = () => ({}),
|
12020
|
-
stickyStyles
|
12025
|
+
stickyStyles,
|
12026
|
+
onClick
|
12021
12027
|
}) => {
|
12022
|
-
var _a;
|
12028
|
+
var _a, _b, _c;
|
12029
|
+
const resolvedAdditionalRowProps = additionalRowProps(row, index, rows);
|
12023
12030
|
const isRowDisabled = (_a = disabled == null ? void 0 : disabled(row, index, rows)) != null ? _a : false;
|
12024
|
-
|
12031
|
+
const isRowSelectionDisabled = (_b = selectionDisabled == null ? void 0 : selectionDisabled(row, index, rows)) != null ? _b : false;
|
12032
|
+
const isRowClickable = !isRowDisabled && !isRowSelectionDisabled && !!onClick;
|
12033
|
+
const style = __spreadProps(__spreadValues({}, (_c = resolvedAdditionalRowProps.style) != null ? _c : {}), {
|
12034
|
+
cursor: isRowClickable ? "pointer" : void 0
|
12035
|
+
});
|
12036
|
+
return /* @__PURE__ */ React68.createElement(DataList.Row, __spreadProps(__spreadValues({
|
12025
12037
|
key: row.id,
|
12026
12038
|
disabled: isRowDisabled,
|
12027
|
-
active
|
12028
|
-
|
12039
|
+
active,
|
12040
|
+
isLast
|
12041
|
+
}, resolvedAdditionalRowProps), {
|
12042
|
+
style,
|
12043
|
+
onClick: isRowClickable ? onClick : void 0
|
12044
|
+
}), renderFirstColumn == null ? void 0 : renderFirstColumn(row, index, rows), /* @__PURE__ */ React68.createElement(List, {
|
12029
12045
|
items: columns,
|
12030
12046
|
renderItem: (column, columnIndex) => {
|
12031
12047
|
const cell2 = /* @__PURE__ */ React68.createElement(DataList.Cell, __spreadProps(__spreadValues(__spreadValues({}, cellProps(column)), additionalColumnProps(column, columnIndex, columns, row)), {
|
@@ -12066,9 +12082,14 @@ var DataListCell = ({
|
|
12066
12082
|
case "action": {
|
12067
12083
|
const action = renameProperty("text", "children", column.action(row, index, rows));
|
12068
12084
|
if (action) {
|
12069
|
-
cellContent = /* @__PURE__ */ React68.createElement(Button.Secondary, __spreadValues({
|
12085
|
+
cellContent = /* @__PURE__ */ React68.createElement(Button.Secondary, __spreadProps(__spreadValues({
|
12070
12086
|
dense: true
|
12071
|
-
}, action)
|
12087
|
+
}, action), {
|
12088
|
+
onClick: (e) => {
|
12089
|
+
action.onClick();
|
12090
|
+
e.stopPropagation();
|
12091
|
+
}
|
12092
|
+
}));
|
12072
12093
|
}
|
12073
12094
|
break;
|
12074
12095
|
}
|
@@ -12120,7 +12141,7 @@ var flattenRows = (rows) => areRowsGrouped(rows) ? Object.values(rows).flatMap(f
|
|
12120
12141
|
var GAP = 8;
|
12121
12142
|
var INDENTATION = 28;
|
12122
12143
|
var sortGroupKeys = (groupKeys) => [...groupKeys].sort((a) => a === "undefined" ? -1 : 1);
|
12123
|
-
var
|
12144
|
+
var getDefaultRowSelectionLabel = () => "Select row";
|
12124
12145
|
var getDefaultGroupCheckboxLabel = (key) => `Select ${key}`;
|
12125
12146
|
var renderDefaultGroupName = (key) => /* @__PURE__ */ React69.createElement(React69.Fragment, null, "Group: ", /* @__PURE__ */ React69.createElement("b", null, key));
|
12126
12147
|
var renderDefaultEmptyGroup = () => /* @__PURE__ */ React69.createElement(DataList.EmptyGroup, {
|
@@ -12130,11 +12151,13 @@ var DataListGroup = (_a) => {
|
|
12130
12151
|
var _b = _a, {
|
12131
12152
|
groups,
|
12132
12153
|
groupKey,
|
12133
|
-
level = 0
|
12154
|
+
level = 0,
|
12155
|
+
isLastGroup
|
12134
12156
|
} = _b, props = __objRest(_b, [
|
12135
12157
|
"groups",
|
12136
12158
|
"groupKey",
|
12137
|
-
"level"
|
12159
|
+
"level",
|
12160
|
+
"isLastGroup"
|
12138
12161
|
]);
|
12139
12162
|
const {
|
12140
12163
|
columns,
|
@@ -12152,16 +12175,18 @@ var DataListGroup = (_a) => {
|
|
12152
12175
|
rows,
|
12153
12176
|
selectable,
|
12154
12177
|
selectedRows,
|
12155
|
-
|
12178
|
+
getOnSelectionChangeForId,
|
12156
12179
|
selectionDisabled = () => false,
|
12157
|
-
|
12180
|
+
getRowSelectionLabel = getDefaultRowSelectionLabel,
|
12158
12181
|
getGroupCheckboxLabel = getDefaultGroupCheckboxLabel
|
12159
12182
|
} = props;
|
12160
12183
|
const groupKeys = groups ? Object.keys(groups) : void 0;
|
12161
12184
|
const hasCustomRowForGroup = isFunction2(getGroupRow);
|
12162
12185
|
if (!areRowsGrouped(groups)) {
|
12163
12186
|
if (groups.length === 0 && groupKey && groupKey !== "undefined") {
|
12164
|
-
return /* @__PURE__ */ React69.createElement(DataList.Row,
|
12187
|
+
return /* @__PURE__ */ React69.createElement(DataList.Row, {
|
12188
|
+
isLast: isLastGroup
|
12189
|
+
}, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null), /* @__PURE__ */ React69.createElement(DataList.Cell, {
|
12165
12190
|
style: { paddingLeft: `${2 + GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
12166
12191
|
}, /* @__PURE__ */ React69.createElement(Typography, {
|
12167
12192
|
variant: "small",
|
@@ -12172,16 +12197,18 @@ var DataListGroup = (_a) => {
|
|
12172
12197
|
items: groups,
|
12173
12198
|
renderItem: (row, index) => {
|
12174
12199
|
var _a2;
|
12175
|
-
const
|
12200
|
+
const isSelected = (_a2 = selectedRows == null ? void 0 : selectedRows.includes(row.id)) != null ? _a2 : false;
|
12176
12201
|
const isDisabled = disabled == null ? void 0 : disabled(row, index, rows);
|
12177
12202
|
const isSelectionDisabled = selectionDisabled(row, index, rows);
|
12203
|
+
const isLastRow = isLastGroup && index === groups.length - 1;
|
12178
12204
|
return /* @__PURE__ */ React69.createElement(DataListRow, {
|
12179
12205
|
key: row.id,
|
12180
12206
|
columns,
|
12181
12207
|
row,
|
12182
12208
|
index,
|
12209
|
+
isLast: isLastRow,
|
12183
12210
|
rows,
|
12184
|
-
active: selectable &&
|
12211
|
+
active: selectable && isSelected,
|
12185
12212
|
menu: /* @__PURE__ */ React69.createElement(DataListRowMenu, {
|
12186
12213
|
row,
|
12187
12214
|
index,
|
@@ -12191,9 +12218,10 @@ var DataListGroup = (_a) => {
|
|
12191
12218
|
menuAriaLabel
|
12192
12219
|
}),
|
12193
12220
|
disabled,
|
12221
|
+
selectionDisabled,
|
12194
12222
|
rowClassName,
|
12195
12223
|
additionalRowProps: () => selectable ? {
|
12196
|
-
"aria-selected":
|
12224
|
+
"aria-selected": isSelected
|
12197
12225
|
} : {},
|
12198
12226
|
additionalColumnProps: (_, columnIndex) => columnIndex === 0 ? {
|
12199
12227
|
style: {
|
@@ -12201,13 +12229,20 @@ var DataListGroup = (_a) => {
|
|
12201
12229
|
}
|
12202
12230
|
} : {},
|
12203
12231
|
renderFirstColumn: (row2, index2) => {
|
12204
|
-
return /* @__PURE__ */ React69.createElement(React69.Fragment, null, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null, /* @__PURE__ */ React69.createElement(
|
12205
|
-
|
12206
|
-
|
12207
|
-
|
12232
|
+
return /* @__PURE__ */ React69.createElement(React69.Fragment, null, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null, selectable === "single" && /* @__PURE__ */ React69.createElement(RadioButton, {
|
12233
|
+
value: row2.id.toString(),
|
12234
|
+
"aria-label": getRowSelectionLabel(row2, index2, isSelected, rows),
|
12235
|
+
onChange: getOnSelectionChangeForId(row2.id),
|
12236
|
+
checked: isSelected,
|
12237
|
+
disabled: isDisabled || isSelectionDisabled
|
12238
|
+
}), selectable === "multiple" && /* @__PURE__ */ React69.createElement(Checkbox, {
|
12239
|
+
"aria-label": getRowSelectionLabel(row2, index2, isSelected, rows),
|
12240
|
+
onChange: getOnSelectionChangeForId(row2.id),
|
12241
|
+
checked: isSelected,
|
12208
12242
|
disabled: isDisabled || isSelectionDisabled
|
12209
12243
|
})));
|
12210
|
-
}
|
12244
|
+
},
|
12245
|
+
onClick: selectable === "single" ? getOnSelectionChangeForId(row.id) : void 0
|
12211
12246
|
});
|
12212
12247
|
}
|
12213
12248
|
});
|
@@ -12226,7 +12261,8 @@ var DataListGroup = (_a) => {
|
|
12226
12261
|
groupKey: "undefined",
|
12227
12262
|
level
|
12228
12263
|
}, props), {
|
12229
|
-
groups: group
|
12264
|
+
groups: group,
|
12265
|
+
isLastGroup: isLastGroup && index === groupKeys.length - 1
|
12230
12266
|
}));
|
12231
12267
|
}
|
12232
12268
|
const openPanelId = expandedGroupIds ? (_a2 = expandedGroupIds.find((id) => id === key)) != null ? _a2 : null : void 0;
|
@@ -12234,17 +12270,20 @@ var DataListGroup = (_a) => {
|
|
12234
12270
|
const nestedSelectedIds = (_b2 = selectedRows == null ? void 0 : selectedRows.filter((id) => nestedRowIds.includes(id))) != null ? _b2 : [];
|
12235
12271
|
const allSelected = nestedRowIds.length === nestedSelectedIds.length;
|
12236
12272
|
const isChecked = nestedSelectedIds.length > 0;
|
12273
|
+
const isActiveRow = !!openPanelId || selectable && isChecked;
|
12274
|
+
const isLastRow = isLastGroup && index === groupKeys.length - 1 && !openPanelId;
|
12237
12275
|
return /* @__PURE__ */ React69.createElement(Accordion, {
|
12238
12276
|
key,
|
12239
12277
|
openPanelId
|
12240
12278
|
}, hasCustomRowForGroup && /* @__PURE__ */ React69.createElement(DataList.Row, {
|
12241
|
-
active:
|
12242
|
-
|
12279
|
+
active: isActiveRow,
|
12280
|
+
isLast: isLastRow
|
12281
|
+
}, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null, selectable === "multiple" && /* @__PURE__ */ React69.createElement(Checkbox, {
|
12243
12282
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
12244
12283
|
checked: isChecked,
|
12245
12284
|
indeterminate: isChecked && !allSelected,
|
12246
12285
|
disabled: group.length === 0,
|
12247
|
-
onChange:
|
12286
|
+
onChange: getOnSelectionChangeForId(nestedRowIds)
|
12248
12287
|
})), /* @__PURE__ */ React69.createElement(List, {
|
12249
12288
|
items: columns,
|
12250
12289
|
renderItem: (column, idx) => /* @__PURE__ */ React69.createElement(DataList.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
@@ -12267,29 +12306,31 @@ var DataListGroup = (_a) => {
|
|
12267
12306
|
onMenuOpenChange,
|
12268
12307
|
menuAriaLabel
|
12269
12308
|
})), !hasCustomRowForGroup && /* @__PURE__ */ React69.createElement(DataList.Row, {
|
12270
|
-
active:
|
12271
|
-
|
12309
|
+
active: isActiveRow,
|
12310
|
+
isLast: isLastRow
|
12311
|
+
}, selectable === "multiple" && /* @__PURE__ */ React69.createElement(DataList.Cell, null, /* @__PURE__ */ React69.createElement(Checkbox, {
|
12272
12312
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
12273
12313
|
checked: isChecked,
|
12274
12314
|
indeterminate: isChecked && !allSelected,
|
12275
12315
|
disabled: group.length === 0,
|
12276
|
-
onChange:
|
12316
|
+
onChange: getOnSelectionChangeForId(nestedRowIds)
|
12277
12317
|
})), /* @__PURE__ */ React69.createElement(DataList.Cell, {
|
12278
12318
|
className: tw("gap-3"),
|
12279
12319
|
style: { paddingLeft: `${GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
12280
12320
|
}, /* @__PURE__ */ React69.createElement(Accordion.Toggle, {
|
12281
12321
|
panelId: key,
|
12282
12322
|
onChange: onGroupToggled
|
12283
|
-
}), renderGroupName(key, group))), /* @__PURE__ */ React69.createElement(
|
12284
|
-
subgroup: true
|
12285
|
-
}, /* @__PURE__ */ React69.createElement(Accordion.UnanimatedPanel, {
|
12323
|
+
}), renderGroupName(key, group))), /* @__PURE__ */ React69.createElement(Accordion.UnanimatedPanel, {
|
12286
12324
|
panelId: key
|
12325
|
+
}, /* @__PURE__ */ React69.createElement(DataList.Row, {
|
12326
|
+
subgroup: true
|
12287
12327
|
}, /* @__PURE__ */ React69.createElement(DataListGroup, __spreadProps(__spreadValues({
|
12288
12328
|
key,
|
12289
12329
|
groupKey: key,
|
12290
12330
|
level: level + 1
|
12291
12331
|
}, props), {
|
12292
|
-
groups: group
|
12332
|
+
groups: group,
|
12333
|
+
isLastGroup: isLastGroup && index === groupKeys.length - 1
|
12293
12334
|
})))));
|
12294
12335
|
}
|
12295
12336
|
});
|
@@ -12309,8 +12350,9 @@ var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
12309
12350
|
height: 17.5
|
12310
12351
|
})))), /* @__PURE__ */ React70.createElement(List, {
|
12311
12352
|
items: [...Array(rows).keys()],
|
12312
|
-
renderItem: (item) => /* @__PURE__ */ React70.createElement(DataList.Row, {
|
12313
|
-
key: item
|
12353
|
+
renderItem: (item, index) => /* @__PURE__ */ React70.createElement(DataList.Row, {
|
12354
|
+
key: item,
|
12355
|
+
isLast: index === rows - 1
|
12314
12356
|
}, /* @__PURE__ */ React70.createElement(List, {
|
12315
12357
|
items: columnsAmount,
|
12316
12358
|
renderItem: (key) => /* @__PURE__ */ React70.createElement(DataList.Cell, {
|
@@ -12375,13 +12417,13 @@ var DataList2 = (_a) => {
|
|
12375
12417
|
getGroupRow,
|
12376
12418
|
renderGroupName,
|
12377
12419
|
renderEmptyGroup,
|
12378
|
-
onGroupToggled,
|
12379
|
-
expandedGroupIds,
|
12420
|
+
onGroupToggled: _onGroupToggled,
|
12421
|
+
expandedGroupIds: _expandedGroupIds,
|
12380
12422
|
defaultSort,
|
12381
12423
|
onSortChanged,
|
12382
12424
|
selectable,
|
12383
12425
|
selectionDisabled = () => false,
|
12384
|
-
|
12426
|
+
getRowSelectionLabel = getDefaultRowSelectionLabel,
|
12385
12427
|
getGroupCheckboxLabel = getDefaultGroupCheckboxLabel,
|
12386
12428
|
selectedRows,
|
12387
12429
|
defaultSelectedRows = [],
|
@@ -12411,7 +12453,7 @@ var DataList2 = (_a) => {
|
|
12411
12453
|
"onSortChanged",
|
12412
12454
|
"selectable",
|
12413
12455
|
"selectionDisabled",
|
12414
|
-
"
|
12456
|
+
"getRowSelectionLabel",
|
12415
12457
|
"getGroupCheckboxLabel",
|
12416
12458
|
"selectedRows",
|
12417
12459
|
"defaultSelectedRows",
|
@@ -12427,6 +12469,15 @@ var DataList2 = (_a) => {
|
|
12427
12469
|
defaultSelectedRows,
|
12428
12470
|
(value) => onSelectionChange == null ? void 0 : onSelectionChange(value != null ? value : [])
|
12429
12471
|
);
|
12472
|
+
const [expandedGroupIds, setExpandedGroupIds] = useControlledState(_expandedGroupIds, []);
|
12473
|
+
const onGroupToggled = (id, open) => {
|
12474
|
+
if (!open) {
|
12475
|
+
setExpandedGroupIds([...expandedGroupIds, id]);
|
12476
|
+
} else {
|
12477
|
+
setExpandedGroupIds(expandedGroupIds.filter((panelId) => panelId !== id));
|
12478
|
+
}
|
12479
|
+
_onGroupToggled == null ? void 0 : _onGroupToggled(id, open);
|
12480
|
+
};
|
12430
12481
|
const defaultSortedColumn = columns.find((c) => c.headerName === (defaultSort == null ? void 0 : defaultSort.headerName));
|
12431
12482
|
const initialSortState = defaultSortedColumn ? { column: defaultSortedColumn, direction: (_a2 = defaultSort == null ? void 0 : defaultSort.direction) != null ? _a2 : "ascending" } : {};
|
12432
12483
|
const [sort, updateSort] = useTableSort(__spreadProps(__spreadValues({}, initialSortState), { onSortChanged }));
|
@@ -12451,9 +12502,11 @@ var DataList2 = (_a) => {
|
|
12451
12502
|
}, children)),
|
12452
12503
|
[]
|
12453
12504
|
);
|
12454
|
-
const
|
12505
|
+
const getOnSelectionChangeForId = (id) => (e) => {
|
12455
12506
|
const ids = castArray2(id);
|
12456
|
-
if (
|
12507
|
+
if (selectable === "single") {
|
12508
|
+
setSelected(ids);
|
12509
|
+
} else if ("checked" in e.target && e.target.checked) {
|
12457
12510
|
setSelected([...selected != null ? selected : [], ...ids]);
|
12458
12511
|
} else {
|
12459
12512
|
setSelected(selected == null ? void 0 : selected.filter((_id) => !ids.includes(_id)));
|
@@ -12476,7 +12529,7 @@ var DataList2 = (_a) => {
|
|
12476
12529
|
}, selectable && /* @__PURE__ */ React72.createElement(DataList.HeadCell, {
|
12477
12530
|
align: "left",
|
12478
12531
|
sticky
|
12479
|
-
}, /* @__PURE__ */ React72.createElement(Checkbox, {
|
12532
|
+
}, selectable === "multiple" && /* @__PURE__ */ React72.createElement(Checkbox, {
|
12480
12533
|
"aria-label": "Select all rows",
|
12481
12534
|
indeterminate: totalSelected > 0 && totalSelected < allRows.length,
|
12482
12535
|
checked: totalSelected > 0,
|
@@ -12537,29 +12590,33 @@ var DataList2 = (_a) => {
|
|
12537
12590
|
selectable,
|
12538
12591
|
selectionDisabled,
|
12539
12592
|
selectedRows: selected,
|
12540
|
-
|
12541
|
-
|
12593
|
+
getOnSelectionChangeForId,
|
12594
|
+
getRowSelectionLabel,
|
12542
12595
|
getGroupCheckboxLabel,
|
12543
12596
|
rows,
|
12544
12597
|
groups,
|
12545
12598
|
groupKey: void 0,
|
12546
|
-
level: 0
|
12599
|
+
level: 0,
|
12600
|
+
isLastGroup: true
|
12547
12601
|
}), !groups && /* @__PURE__ */ React72.createElement(List, __spreadProps(__spreadValues({}, rest), {
|
12548
12602
|
paginationContainer: PaginationFooter,
|
12549
12603
|
items: sortedRows,
|
12550
12604
|
renderItem: (row, index) => {
|
12551
12605
|
var _a3;
|
12552
12606
|
const details = rowDetails == null ? void 0 : rowDetails(row, index, sortedRows);
|
12553
|
-
const
|
12607
|
+
const isSelected = (_a3 = selected == null ? void 0 : selected.includes(row.id)) != null ? _a3 : false;
|
12554
12608
|
const isSelectionDisabled = selectionDisabled == null ? void 0 : selectionDisabled(row, index, sortedRows);
|
12555
12609
|
const isDisabled = disabled == null ? void 0 : disabled(row, index, sortedRows);
|
12610
|
+
const openPanelId = expandedGroupIds.find((id) => id === row.id.toString()) || null;
|
12611
|
+
const isLastRow = index === sortedRows.length - 1;
|
12556
12612
|
const content = /* @__PURE__ */ React72.createElement(DataListRow, {
|
12557
12613
|
key: row.id,
|
12558
12614
|
columns,
|
12559
12615
|
row,
|
12560
12616
|
index,
|
12561
12617
|
rows: sortedRows,
|
12562
|
-
active: selectable &&
|
12618
|
+
active: selectable && isSelected,
|
12619
|
+
isLast: isLastRow && !openPanelId,
|
12563
12620
|
stickyStyles,
|
12564
12621
|
menu: /* @__PURE__ */ React72.createElement(DataListRowMenu, {
|
12565
12622
|
row,
|
@@ -12570,6 +12627,7 @@ var DataList2 = (_a) => {
|
|
12570
12627
|
menuAriaLabel
|
12571
12628
|
}),
|
12572
12629
|
disabled,
|
12630
|
+
selectionDisabled,
|
12573
12631
|
rowClassName,
|
12574
12632
|
additionalRowProps: (row2) => {
|
12575
12633
|
var _a4;
|
@@ -12578,27 +12636,36 @@ var DataList2 = (_a) => {
|
|
12578
12636
|
} : {};
|
12579
12637
|
},
|
12580
12638
|
renderFirstColumn: (row2, index2) => {
|
12581
|
-
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, selectable && /* @__PURE__ */ React72.createElement(DataList.Cell, null, /* @__PURE__ */ React72.createElement(
|
12582
|
-
|
12583
|
-
|
12584
|
-
|
12639
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, selectable && /* @__PURE__ */ React72.createElement(DataList.Cell, null, selectable === "single" && /* @__PURE__ */ React72.createElement(RadioButton, {
|
12640
|
+
value: row2.id.toString(),
|
12641
|
+
"aria-label": getRowSelectionLabel(row2, index2, isSelected, sortedRows),
|
12642
|
+
onChange: getOnSelectionChangeForId(row2.id),
|
12643
|
+
checked: isSelected,
|
12644
|
+
disabled: isDisabled || isSelectionDisabled
|
12645
|
+
}), selectable === "multiple" && /* @__PURE__ */ React72.createElement(Checkbox, {
|
12646
|
+
"aria-label": getRowSelectionLabel(row2, index2, isSelected, sortedRows),
|
12647
|
+
onChange: getOnSelectionChangeForId(row2.id),
|
12648
|
+
checked: isSelected,
|
12585
12649
|
disabled: isDisabled || isSelectionDisabled
|
12586
12650
|
})), rowDetails !== void 0 && /* @__PURE__ */ React72.createElement(DataList.Cell, null, details && /* @__PURE__ */ React72.createElement(Accordion.Toggle, {
|
12587
12651
|
panelId: row2.id.toString(),
|
12588
12652
|
onChange: onGroupToggled
|
12589
12653
|
})));
|
12590
|
-
}
|
12654
|
+
},
|
12655
|
+
onClick: selectable === "single" ? getOnSelectionChangeForId(row.id) : void 0
|
12591
12656
|
});
|
12592
12657
|
if (!details) {
|
12593
12658
|
return content;
|
12594
12659
|
}
|
12595
12660
|
return /* @__PURE__ */ React72.createElement(Accordion, {
|
12596
12661
|
key: row.id,
|
12597
|
-
openPanelId
|
12662
|
+
openPanelId
|
12598
12663
|
}, content, /* @__PURE__ */ React72.createElement(Accordion.Panel, {
|
12599
12664
|
role: "row",
|
12600
12665
|
panelId: row.id.toString(),
|
12601
|
-
className: tw("col-span-full bg-muted border-
|
12666
|
+
className: tw("col-span-full bg-muted border-default", {
|
12667
|
+
"border-b": !isLastRow
|
12668
|
+
}),
|
12602
12669
|
"aria-label": `row ${row.id.toString()} details`
|
12603
12670
|
}, /* @__PURE__ */ React72.createElement("div", {
|
12604
12671
|
role: "cell"
|