trotl-table 1.0.48 → 1.0.50

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/Table.cjs.js CHANGED
@@ -10389,6 +10389,15 @@ function TableInner({
10389
10389
  key,
10390
10390
  style
10391
10391
  }) => {
10392
+ // override virtualization's fixed width so that flex-based cells can
10393
+ // expand/contract with the header. without this the header adjusts but
10394
+ // rows keep the original pixel width from the first render, leading to
10395
+ // the mismatched behaviour described by the user.
10396
+ const fullStyle = {
10397
+ ...style,
10398
+ width: "100%",
10399
+ boxSizing: "border-box"
10400
+ };
10392
10401
  const item = tableDataFlat[index];
10393
10402
  if (!item) return null;
10394
10403
  if (item.type === "group") {
@@ -10421,7 +10430,7 @@ function TableInner({
10421
10430
  ref: ref,
10422
10431
  key: key,
10423
10432
  style: {
10424
- ...style,
10433
+ ...fullStyle,
10425
10434
  background: '#f6f6fa',
10426
10435
  border: '2px dashed #bbb',
10427
10436
  textAlign: 'center',
@@ -10471,7 +10480,7 @@ function TableInner({
10471
10480
  // Default: normal group header
10472
10481
  return /*#__PURE__*/React.createElement("div", {
10473
10482
  key: key,
10474
- style: style,
10483
+ style: fullStyle,
10475
10484
  className: "table-row group-row",
10476
10485
  onClick: () => toggleGroup(gid)
10477
10486
  }, enableMultiSelect && showDelete && /*#__PURE__*/React.createElement("div", {
@@ -10532,14 +10541,15 @@ function TableInner({
10532
10541
  };
10533
10542
  const content = /*#__PURE__*/React.createElement("div", {
10534
10543
  key: key,
10535
- style: style,
10544
+ style: fullStyle,
10536
10545
  className: "table-row"
10537
10546
  }, /*#__PURE__*/React.createElement("div", {
10538
10547
  className: "row-main",
10539
10548
  onDoubleClick: doubleClickEnable ? handleRowDoubleClick : undefined,
10540
10549
  style: {
10541
10550
  display: 'flex',
10542
- flex: 1
10551
+ flex: '1 1 0%',
10552
+ minWidth: 0
10543
10553
  }
10544
10554
  }, enableMultiSelect && showDelete && /*#__PURE__*/React.createElement("div", {
10545
10555
  className: "table-cell checkbox-cell"
@@ -10687,8 +10697,9 @@ function TableInner({
10687
10697
  position: "sticky",
10688
10698
  top: 0,
10689
10699
  zIndex: 10,
10690
- background: "#fff",
10691
- paddingRight: headerPadRight || undefined
10700
+ background: "var(--table-bg)",
10701
+ boxSizing: "border-box",
10702
+ paddingRight: undefined
10692
10703
  }
10693
10704
  }, /*#__PURE__*/React.createElement("div", {
10694
10705
  className: "table-row header-row"
@@ -10738,7 +10749,17 @@ function TableInner({
10738
10749
  title: translate("action")
10739
10750
  }, showIcons ? /*#__PURE__*/React.createElement("span", {
10740
10751
  title: translate("action")
10741
- }, "\u2699\uFE0F") : translate("action")))), /*#__PURE__*/React.createElement("div", {
10752
+ }, "\u2699\uFE0F") : translate("action")), headerPadRight > 0 && /*#__PURE__*/React.createElement("div", {
10753
+ className: "table-cell header-scroll-spacer",
10754
+ style: {
10755
+ flex: `0 0 ${headerPadRight}px`,
10756
+ minWidth: headerPadRight,
10757
+ maxWidth: headerPadRight,
10758
+ padding: 0,
10759
+ border: "none",
10760
+ background: "var(--table-bg)"
10761
+ }
10762
+ }))), /*#__PURE__*/React.createElement("div", {
10742
10763
  className: "main-table",
10743
10764
  ref: listRef
10744
10765
  }, tableDataFlat.length === 0 ? /*#__PURE__*/React.createElement(DotsLoading.default, null) : /*#__PURE__*/React.createElement(AutoSizer, null, ({