@bwp-web/components 0.13.5 → 0.13.6

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/index.js CHANGED
@@ -467,6 +467,7 @@ function BiampLayout({
467
467
  import {
468
468
  Box as Box4,
469
469
  Checkbox,
470
+ IconButton,
470
471
  Table as MuiTable,
471
472
  TableBody,
472
473
  TableCell,
@@ -476,6 +477,7 @@ import {
476
477
  TableSortLabel
477
478
  } from "@mui/material";
478
479
  import {
480
+ ChevronDownIcon,
479
481
  ChevronRightIcon,
480
482
  DropdownChevronDownIcon,
481
483
  DropdownChevronUpIcon
@@ -664,25 +666,9 @@ var checkboxHiddenSx = { visibility: "hidden" };
664
666
  var expandCellBaseSx = {
665
667
  display: "flex",
666
668
  alignItems: "center",
667
- gap: 1
669
+ gap: "2px"
668
670
  };
669
- var chevronExpandedSx = {
670
- color: ({ palette }) => palette.text.secondary,
671
- transition: "transform 150ms ease",
672
- transform: "rotate(90deg)",
673
- width: 16,
674
- height: 16,
675
- cursor: "pointer"
676
- };
677
- var chevronCollapsedSx = {
678
- color: ({ palette }) => palette.text.secondary,
679
- transition: "transform 150ms ease",
680
- transform: "rotate(0deg)",
681
- width: 16,
682
- height: 16,
683
- cursor: "pointer"
684
- };
685
- var expandPlaceholderSx = { width: 16 };
671
+ var expandPlaceholderSx = { width: 28 };
686
672
  var headerSelectionCellSx = {
687
673
  position: "sticky",
688
674
  left: 0,
@@ -692,6 +678,8 @@ var headerSelectionCellSx = {
692
678
  var checkboxHiddenHeaderSx = { visibility: "hidden" };
693
679
  function BiampTableRowInner({
694
680
  row,
681
+ isExpanded,
682
+ isSelected,
695
683
  onRowClick,
696
684
  isRowClickable,
697
685
  enableRowSelection,
@@ -705,7 +693,7 @@ function BiampTableRowInner({
705
693
  TableRow,
706
694
  {
707
695
  hover: clickable,
708
- selected: enableRowSelection ? row.getIsSelected() : void 0,
696
+ selected: enableRowSelection ? isSelected : void 0,
709
697
  role: clickable ? "button" : void 0,
710
698
  tabIndex: clickable ? 0 : void 0,
711
699
  sx: clickable ? rowCursorPointerSx : void 0,
@@ -720,7 +708,7 @@ function BiampTableRowInner({
720
708
  enableRowSelection && /* @__PURE__ */ jsx8(TableCell, { padding: "checkbox", sx: selectionCellSx, children: /* @__PURE__ */ jsx8(
721
709
  Checkbox,
722
710
  {
723
- checked: row.getIsSelected(),
711
+ checked: isSelected,
724
712
  disabled: !row.getCanSelect(),
725
713
  onChange: (e) => row.toggleSelected(e.target.checked, {
726
714
  selectChildren: selectChildrenWithParent
@@ -745,7 +733,10 @@ function BiampTableRowInner({
745
733
  TableCell,
746
734
  {
747
735
  "data-sticky": sticky || void 0,
748
- sx: cellSx(sticky, cell.column.columnDef.meta?.minWidth, 2),
736
+ sx: {
737
+ ...cellSx(sticky, cell.column.columnDef.meta?.minWidth, 2),
738
+ pl: isExpandCell ? "6px" : "12px"
739
+ },
749
740
  children: (() => {
750
741
  if (sticky) return content;
751
742
  const truncate = cell.column.columnDef.meta?.truncate ?? true;
@@ -758,16 +749,32 @@ function BiampTableRowInner({
758
749
  sx: row.depth > 0 ? { ...expandCellBaseSx, pl: `${row.depth * 12}px` } : expandCellBaseSx,
759
750
  children: [
760
751
  row.getCanExpand() ? /* @__PURE__ */ jsx8(
761
- ChevronRightIcon,
752
+ IconButton,
762
753
  {
754
+ variant: "none",
763
755
  onClick: (e) => {
764
756
  e.stopPropagation();
765
757
  row.toggleExpanded();
766
758
  },
767
- "aria-label": row.getIsExpanded() ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
768
- "aria-expanded": row.getIsExpanded(),
769
- variant: "xs",
770
- sx: row.getIsExpanded() ? chevronExpandedSx : chevronCollapsedSx
759
+ "aria-label": isExpanded ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
760
+ "aria-expanded": isExpanded,
761
+ children: isExpanded ? /* @__PURE__ */ jsx8(
762
+ ChevronDownIcon,
763
+ {
764
+ variant: "xs",
765
+ sx: {
766
+ color: ({ palette }) => palette.text.secondary
767
+ }
768
+ }
769
+ ) : /* @__PURE__ */ jsx8(
770
+ ChevronRightIcon,
771
+ {
772
+ variant: "xs",
773
+ sx: {
774
+ color: ({ palette }) => palette.text.secondary
775
+ }
776
+ }
777
+ )
771
778
  }
772
779
  ) : hasExpandableRows ? /* @__PURE__ */ jsx8(Box4, { sx: expandPlaceholderSx }) : null,
773
780
  truncated
@@ -785,7 +792,7 @@ function BiampTableRowInner({
785
792
  );
786
793
  }
787
794
  function biampTableRowPropsAreEqual(prev, next) {
788
- return prev.row.id === next.row.id && prev.row.original === next.row.original && prev.row.getIsSelected() === next.row.getIsSelected() && prev.row.getIsExpanded() === next.row.getIsExpanded() && prev.row.getVisibleCells().length === next.row.getVisibleCells().length && prev.enableRowSelection === next.enableRowSelection && prev.enableExpanding === next.enableExpanding && prev.hasExpandableRows === next.hasExpandableRows && prev.selectChildrenWithParent === next.selectChildrenWithParent && prev.onRowClick === next.onRowClick && prev.isRowClickable === next.isRowClickable && prev.getRowLabel === next.getRowLabel;
795
+ return prev.row.id === next.row.id && prev.row.original === next.row.original && prev.isSelected === next.isSelected && prev.isExpanded === next.isExpanded && prev.row.getVisibleCells().length === next.row.getVisibleCells().length && prev.enableRowSelection === next.enableRowSelection && prev.enableExpanding === next.enableExpanding && prev.hasExpandableRows === next.hasExpandableRows && prev.selectChildrenWithParent === next.selectChildrenWithParent && prev.onRowClick === next.onRowClick && prev.isRowClickable === next.isRowClickable && prev.getRowLabel === next.getRowLabel;
789
796
  }
790
797
  var BiampTableRow = React2.memo(
791
798
  BiampTableRowInner,
@@ -829,8 +836,6 @@ function BiampTable({
829
836
  display: "flex",
830
837
  flexDirection: "column",
831
838
  height: "100%",
832
- overflow: "auto",
833
- overscrollBehavior: "none",
834
839
  position: "relative",
835
840
  ...sx
836
841
  },
@@ -894,6 +899,8 @@ function BiampTable({
894
899
  BiampTableRow,
895
900
  {
896
901
  row,
902
+ isExpanded: row.getIsExpanded(),
903
+ isSelected: row.getIsSelected(),
897
904
  onRowClick,
898
905
  isRowClickable,
899
906
  enableRowSelection,
@@ -949,7 +956,7 @@ function BiampTableContainer({
949
956
  }
950
957
 
951
958
  // src/BiampTable/BiampTableCellActionButton.tsx
952
- import { IconButton, Tooltip as Tooltip2 } from "@mui/material";
959
+ import { IconButton as IconButton2, Tooltip as Tooltip2 } from "@mui/material";
953
960
  import { jsx as jsx10 } from "react/jsx-runtime";
954
961
  function BiampTableCellActionButton({ label, icon, ...props }) {
955
962
  return /* @__PURE__ */ jsx10(
@@ -960,7 +967,7 @@ function BiampTableCellActionButton({ label, icon, ...props }) {
960
967
  enterDelay: 500,
961
968
  enterNextDelay: 500,
962
969
  disableInteractive: true,
963
- children: /* @__PURE__ */ jsx10("span", { children: /* @__PURE__ */ jsx10(IconButton, { "aria-label": label, ...props, children: icon }) })
970
+ children: /* @__PURE__ */ jsx10("span", { children: /* @__PURE__ */ jsx10(IconButton2, { "aria-label": label, ...props, children: icon }) })
964
971
  }
965
972
  );
966
973
  }
@@ -1103,7 +1110,7 @@ import { useState as useState3 } from "react";
1103
1110
  // src/BiampTable/BiampTableToolbarActionButton.tsx
1104
1111
  import {
1105
1112
  Badge,
1106
- IconButton as IconButton2
1113
+ IconButton as IconButton3
1107
1114
  } from "@mui/material";
1108
1115
  import { jsx as jsx12 } from "react/jsx-runtime";
1109
1116
  function BiampTableToolbarActionButton({
@@ -1114,7 +1121,7 @@ function BiampTableToolbarActionButton({
1114
1121
  }) {
1115
1122
  const showBadge = badgeContent != null && badgeContent !== 0;
1116
1123
  return /* @__PURE__ */ jsx12(
1117
- IconButton2,
1124
+ IconButton3,
1118
1125
  {
1119
1126
  "aria-label": showBadge ? `${label} (${badgeContent})` : label,
1120
1127
  ...props,
@@ -1317,7 +1324,7 @@ import {
1317
1324
  Button,
1318
1325
  Divider as Divider2,
1319
1326
  Drawer,
1320
- IconButton as IconButton3,
1327
+ IconButton as IconButton4,
1321
1328
  Typography as Typography4
1322
1329
  } from "@mui/material";
1323
1330
  import { CloseIcon, FilterIcon } from "@bwp-web/assets";
@@ -1394,7 +1401,7 @@ function BiampTableToolbarFilters({
1394
1401
  )
1395
1402
  ] }),
1396
1403
  /* @__PURE__ */ jsx18(
1397
- IconButton3,
1404
+ IconButton4,
1398
1405
  {
1399
1406
  size: "medium",
1400
1407
  onClick: handleClose,
@@ -1455,7 +1462,7 @@ function BiampTableToolbarFilters({
1455
1462
  import {
1456
1463
  Box as Box9,
1457
1464
  Collapse,
1458
- IconButton as IconButton4,
1465
+ IconButton as IconButton5,
1459
1466
  InputAdornment as InputAdornment2,
1460
1467
  InputBase,
1461
1468
  TextField as TextField2,
@@ -1534,7 +1541,7 @@ function BiampTableToolbarSearch({
1534
1541
  }
1535
1542
  };
1536
1543
  const clearButton = inputValue ? /* @__PURE__ */ jsx19(InputAdornment2, { position: "end", children: /* @__PURE__ */ jsx19(
1537
- IconButton4,
1544
+ IconButton5,
1538
1545
  {
1539
1546
  size: "small",
1540
1547
  onClick: handleClear,
@@ -1604,7 +1611,7 @@ function BiampTableToolbarSearch({
1604
1611
  if (expandable) {
1605
1612
  return /* @__PURE__ */ jsxs9(Box9, { display: "flex", alignItems: "center", minWidth: 28, children: [
1606
1613
  /* @__PURE__ */ jsx19(
1607
- IconButton4,
1614
+ IconButton5,
1608
1615
  {
1609
1616
  "aria-label": expandLabel ?? placeholder,
1610
1617
  onClick: () => setIsExpanded(true),