@aivenio/aquarium 1.63.0 → 1.65.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/system.mjs CHANGED
@@ -10674,6 +10674,14 @@ var SortCell = (_a) => {
10674
10674
  className: getSortCellIconClassNames(direction === "descending")
10675
10675
  }))));
10676
10676
  };
10677
+ var EmptyGroup = ({ icon, children }) => /* @__PURE__ */ React63.createElement("div", {
10678
+ className: tw("flex gap-3 items-center")
10679
+ }, icon && /* @__PURE__ */ React63.createElement(Icon, {
10680
+ icon,
10681
+ width: 22
10682
+ }), children);
10683
+ DataList.EmptyGroup = EmptyGroup;
10684
+ DataList.EmptyGroup.displayName = "DataList.EmptyGroup";
10677
10685
  DataList.HeadCell = HeadCell;
10678
10686
  DataList.HeadCell.displayName = "DataList.HeadCell";
10679
10687
  DataList.SortCell = SortCell;
@@ -11271,6 +11279,7 @@ var useDataListContext = () => {
11271
11279
  // src/molecules/DataList/DataListGroup.tsx
11272
11280
  import React68 from "react";
11273
11281
  import isFunction2 from "lodash/isFunction";
11282
+ var import_infoSign3 = __toESM(require_infoSign());
11274
11283
 
11275
11284
  // src/molecules/DataList/utils.ts
11276
11285
  var flattenRows = (rows) => areRowsGrouped(rows) ? Object.values(rows).flatMap(flattenRows) : rows;
@@ -11281,12 +11290,18 @@ var INDENTATION = 28;
11281
11290
  var sortGroupKeys = (groupKeys) => [...groupKeys].sort((a) => a === "undefined" ? -1 : 1);
11282
11291
  var getDefaultRowCheckboxLabel = () => "Select row";
11283
11292
  var getDefaultGroupCheckboxLabel = (key) => `Select ${key}`;
11293
+ var renderDefaultGroupName = (key) => /* @__PURE__ */ React68.createElement(React68.Fragment, null, "Group: ", /* @__PURE__ */ React68.createElement("b", null, key));
11294
+ var renderDefaultEmptyGroup = () => /* @__PURE__ */ React68.createElement(DataList.EmptyGroup, {
11295
+ icon: import_infoSign3.default
11296
+ }, "This group is empty");
11284
11297
  var DataListGroup = (_a) => {
11285
11298
  var _b = _a, {
11286
11299
  groups,
11300
+ groupKey,
11287
11301
  level = 0
11288
11302
  } = _b, props = __objRest(_b, [
11289
11303
  "groups",
11304
+ "groupKey",
11290
11305
  "level"
11291
11306
  ]);
11292
11307
  const {
@@ -11294,6 +11309,8 @@ var DataListGroup = (_a) => {
11294
11309
  disabled,
11295
11310
  expandedGroupIds,
11296
11311
  getGroupRow,
11312
+ renderGroupName = renderDefaultGroupName,
11313
+ renderEmptyGroup = renderDefaultEmptyGroup,
11297
11314
  menu,
11298
11315
  menuAriaLabel,
11299
11316
  onAction,
@@ -11309,6 +11326,14 @@ var DataListGroup = (_a) => {
11309
11326
  const groupKeys = groups ? Object.keys(groups) : void 0;
11310
11327
  const hasCustomRowForGroup = isFunction2(getGroupRow);
11311
11328
  if (!areRowsGrouped(groups)) {
11329
+ if (groups.length === 0 && groupKey !== void 0 && renderEmptyGroup) {
11330
+ return /* @__PURE__ */ React68.createElement(DataList.Row, null, selectable && /* @__PURE__ */ React68.createElement(DataList.Cell, null), /* @__PURE__ */ React68.createElement(DataList.Cell, {
11331
+ style: { paddingLeft: `${2 + GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
11332
+ }, /* @__PURE__ */ React68.createElement(Typography, {
11333
+ variant: "small",
11334
+ color: "muted"
11335
+ }, renderEmptyGroup(groupKey))));
11336
+ }
11312
11337
  return /* @__PURE__ */ React68.createElement(List, {
11313
11338
  items: groups,
11314
11339
  renderItem: (row, index) => {
@@ -11362,6 +11387,7 @@ var DataListGroup = (_a) => {
11362
11387
  if (key === "undefined" || key === void 0) {
11363
11388
  return /* @__PURE__ */ React68.createElement(DataListGroup, __spreadProps(__spreadValues({
11364
11389
  key: "undefined",
11390
+ groupKey: "undefined",
11365
11391
  level
11366
11392
  }, props), {
11367
11393
  groups: group
@@ -11381,6 +11407,7 @@ var DataListGroup = (_a) => {
11381
11407
  "aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
11382
11408
  checked: isChecked,
11383
11409
  indeterminate: isChecked && !allSelected,
11410
+ disabled: group.length === 0,
11384
11411
  onChange: onSelectionChange(nestedRowIds)
11385
11412
  })), /* @__PURE__ */ React68.createElement(List, {
11386
11413
  items: columns,
@@ -11409,6 +11436,7 @@ var DataListGroup = (_a) => {
11409
11436
  "aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
11410
11437
  checked: isChecked,
11411
11438
  indeterminate: isChecked && !allSelected,
11439
+ disabled: group.length === 0,
11412
11440
  onChange: onSelectionChange(nestedRowIds)
11413
11441
  })), /* @__PURE__ */ React68.createElement(DataList.Cell, {
11414
11442
  className: tw("gap-3"),
@@ -11416,11 +11444,13 @@ var DataListGroup = (_a) => {
11416
11444
  }, /* @__PURE__ */ React68.createElement(Accordion.Toggle, {
11417
11445
  panelId: key,
11418
11446
  onChange: onGroupToggled
11419
- }), "Group: ", /* @__PURE__ */ React68.createElement("b", null, key))), /* @__PURE__ */ React68.createElement(DataList.Row, {
11447
+ }), renderGroupName(key, group))), /* @__PURE__ */ React68.createElement(DataList.Row, {
11420
11448
  subgroup: true
11421
11449
  }, /* @__PURE__ */ React68.createElement(Accordion.UnanimatedPanel, {
11422
11450
  panelId: key
11423
11451
  }, /* @__PURE__ */ React68.createElement(DataListGroup, __spreadProps(__spreadValues({
11452
+ key,
11453
+ groupKey: key,
11424
11454
  level: level + 1
11425
11455
  }, props), {
11426
11456
  groups: group
@@ -11506,6 +11536,8 @@ var DataList2 = (_a) => {
11506
11536
  group,
11507
11537
  disabled,
11508
11538
  getGroupRow,
11539
+ renderGroupName,
11540
+ renderEmptyGroup,
11509
11541
  onGroupToggled,
11510
11542
  expandedGroupIds,
11511
11543
  defaultSort,
@@ -11532,6 +11564,8 @@ var DataList2 = (_a) => {
11532
11564
  "group",
11533
11565
  "disabled",
11534
11566
  "getGroupRow",
11567
+ "renderGroupName",
11568
+ "renderEmptyGroup",
11535
11569
  "onGroupToggled",
11536
11570
  "expandedGroupIds",
11537
11571
  "defaultSort",
@@ -11648,6 +11682,8 @@ var DataList2 = (_a) => {
11648
11682
  columns,
11649
11683
  disabled,
11650
11684
  getGroupRow,
11685
+ renderGroupName,
11686
+ renderEmptyGroup,
11651
11687
  expandedGroupIds,
11652
11688
  menu,
11653
11689
  menuAriaLabel,
@@ -11661,6 +11697,7 @@ var DataList2 = (_a) => {
11661
11697
  getGroupCheckboxLabel,
11662
11698
  rows,
11663
11699
  groups,
11700
+ groupKey: void 0,
11664
11701
  level: 0
11665
11702
  }), !groups && /* @__PURE__ */ React71.createElement(List, __spreadProps(__spreadValues({}, rest), {
11666
11703
  paginationContainer: PaginationFooter,