@canvas-components/react-list-table 0.2.5 → 0.2.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.cjs CHANGED
@@ -3437,7 +3437,7 @@ function ReactTableToolbar(props) {
3437
3437
  children: /* @__PURE__ */ jsxRuntime.jsx(ColumnHeightOutlined, {})
3438
3438
  }
3439
3439
  ),
3440
- densityOpen ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "react-list-table-tool-menu", children: [48, 40, 32].map((height) => /* @__PURE__ */ jsxRuntime.jsx(
3440
+ densityOpen ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "react-list-table-tool-menu", children: [56, 48, 32].map((height) => /* @__PURE__ */ jsxRuntime.jsx(
3441
3441
  "button",
3442
3442
  {
3443
3443
  type: "button",
@@ -3446,7 +3446,7 @@ function ReactTableToolbar(props) {
3446
3446
  props.onDensityChange(height);
3447
3447
  setDensityOpen(false);
3448
3448
  },
3449
- children: height === 48 ? "\u5BBD\u677E" : height === 40 ? "\u4E2D\u7B49" : "\u7D27\u51D1"
3449
+ children: height === 56 ? "\u5BBD\u677E" : height === 48 ? "\u4E2D\u7B49" : "\u7D27\u51D1"
3450
3450
  },
3451
3451
  height
3452
3452
  )) }) : null
@@ -3796,8 +3796,10 @@ function ReactListTableInner(props, ref) {
3796
3796
  [columns, columnVisibility, columnOrders, columnConfig]
3797
3797
  );
3798
3798
  const resolvedRowHeight = densityOverride ?? rowHeight;
3799
- const options = react.useMemo(
3800
- () => buildListTableOptions({
3799
+ const resolvedHeaderRowHeight = densityOverride ?? headerRowHeight;
3800
+ const resolvedSummaryRowHeight = densityOverride ?? summaryRowHeight;
3801
+ const options = react.useMemo(() => {
3802
+ const nextOptions = buildListTableOptions({
3801
3803
  width,
3802
3804
  height,
3803
3805
  emptyText,
@@ -3814,8 +3816,8 @@ function ReactListTableInner(props, ref) {
3814
3816
  contextMenu,
3815
3817
  grouping,
3816
3818
  rowHeight: resolvedRowHeight,
3817
- headerRowHeight,
3818
- summaryRowHeight,
3819
+ headerRowHeight: resolvedHeaderRowHeight,
3820
+ summaryRowHeight: resolvedSummaryRowHeight,
3819
3821
  overscanRowCount,
3820
3822
  query,
3821
3823
  rowSelector,
@@ -3831,43 +3833,49 @@ function ReactListTableInner(props, ref) {
3831
3833
  tableId,
3832
3834
  rowDrag,
3833
3835
  debug
3834
- }),
3835
- [
3836
- width,
3837
- height,
3838
- emptyText,
3839
- scroll,
3840
- locale,
3841
- onChange,
3842
- rowKey,
3843
- resolvedColumns,
3844
- dataSource,
3845
- onRow,
3846
- theme,
3847
- striped,
3848
- highlightMode,
3849
- contextMenu,
3850
- grouping,
3851
- resolvedRowHeight,
3852
- headerRowHeight,
3853
- summaryRowHeight,
3854
- overscanRowCount,
3855
- query,
3856
- rowSelector,
3857
- rowSelection,
3858
- expandable,
3859
- pagination,
3860
- scrollbar,
3861
- carouselScroll,
3862
- stretchColumns,
3863
- resizable,
3864
- storageKey,
3865
- draggable,
3866
- tableId,
3867
- rowDrag,
3868
- debug
3869
- ]
3870
- );
3836
+ });
3837
+ return {
3838
+ ...nextOptions,
3839
+ ui: {
3840
+ ...nextOptions.ui,
3841
+ onDensityChange: setDensityOverride
3842
+ }
3843
+ };
3844
+ }, [
3845
+ width,
3846
+ height,
3847
+ emptyText,
3848
+ scroll,
3849
+ locale,
3850
+ onChange,
3851
+ rowKey,
3852
+ resolvedColumns,
3853
+ dataSource,
3854
+ onRow,
3855
+ theme,
3856
+ striped,
3857
+ highlightMode,
3858
+ contextMenu,
3859
+ grouping,
3860
+ resolvedRowHeight,
3861
+ resolvedHeaderRowHeight,
3862
+ resolvedSummaryRowHeight,
3863
+ overscanRowCount,
3864
+ query,
3865
+ rowSelector,
3866
+ rowSelection,
3867
+ expandable,
3868
+ pagination,
3869
+ scrollbar,
3870
+ carouselScroll,
3871
+ stretchColumns,
3872
+ resizable,
3873
+ storageKey,
3874
+ draggable,
3875
+ tableId,
3876
+ rowDrag,
3877
+ debug
3878
+ ]);
3871
3879
  const {
3872
3880
  containerRef,
3873
3881
  tableRef,
@@ -3924,10 +3932,11 @@ function ReactListTableInner(props, ref) {
3924
3932
  title,
3925
3933
  toolbar,
3926
3934
  columns: resolvedColumns,
3927
- density: resolvedRowHeight === "auto" ? 40 : resolvedRowHeight ?? 40,
3935
+ density: resolvedRowHeight === "auto" ? 32 : resolvedRowHeight ?? 32,
3928
3936
  hostRef: shellRef,
3929
3937
  onExport: (options2) => tableRef.current?.exportXlsx(options2),
3930
3938
  onDensityChange: (density) => {
3939
+ tableRef.current?.changeDensity(density);
3931
3940
  setDensityOverride(density);
3932
3941
  if (toolbar) {
3933
3942
  toolbar.onDensityChange?.(density);