@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 +53 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +53 -44
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -37,7 +37,7 @@ interface ReactListTableToolbarOptions {
|
|
|
37
37
|
exportOptions?: ListTableExportXlsxOptions;
|
|
38
38
|
onRefresh?: () => void;
|
|
39
39
|
/** 表格密度变化回调,依次对应紧凑、中等和宽松。 */
|
|
40
|
-
onDensityChange?: (density: 32 |
|
|
40
|
+
onDensityChange?: (density: 32 | 48 | 56) => void;
|
|
41
41
|
/** 自定义导出行为;未配置时默认异步导出全量 XLSX 数据。 */
|
|
42
42
|
onExport?: () => void;
|
|
43
43
|
/** 自定义全屏节点,默认使用表格根容器。 */
|
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ interface ReactListTableToolbarOptions {
|
|
|
37
37
|
exportOptions?: ListTableExportXlsxOptions;
|
|
38
38
|
onRefresh?: () => void;
|
|
39
39
|
/** 表格密度变化回调,依次对应紧凑、中等和宽松。 */
|
|
40
|
-
onDensityChange?: (density: 32 |
|
|
40
|
+
onDensityChange?: (density: 32 | 48 | 56) => void;
|
|
41
41
|
/** 自定义导出行为;未配置时默认异步导出全量 XLSX 数据。 */
|
|
42
42
|
onExport?: () => void;
|
|
43
43
|
/** 自定义全屏节点,默认使用表格根容器。 */
|
package/dist/index.js
CHANGED
|
@@ -3435,7 +3435,7 @@ function ReactTableToolbar(props) {
|
|
|
3435
3435
|
children: /* @__PURE__ */ jsx(ColumnHeightOutlined, {})
|
|
3436
3436
|
}
|
|
3437
3437
|
),
|
|
3438
|
-
densityOpen ? /* @__PURE__ */ jsx("div", { className: "react-list-table-tool-menu", children: [
|
|
3438
|
+
densityOpen ? /* @__PURE__ */ jsx("div", { className: "react-list-table-tool-menu", children: [56, 48, 32].map((height) => /* @__PURE__ */ jsx(
|
|
3439
3439
|
"button",
|
|
3440
3440
|
{
|
|
3441
3441
|
type: "button",
|
|
@@ -3444,7 +3444,7 @@ function ReactTableToolbar(props) {
|
|
|
3444
3444
|
props.onDensityChange(height);
|
|
3445
3445
|
setDensityOpen(false);
|
|
3446
3446
|
},
|
|
3447
|
-
children: height ===
|
|
3447
|
+
children: height === 56 ? "\u5BBD\u677E" : height === 48 ? "\u4E2D\u7B49" : "\u7D27\u51D1"
|
|
3448
3448
|
},
|
|
3449
3449
|
height
|
|
3450
3450
|
)) }) : null
|
|
@@ -3794,8 +3794,10 @@ function ReactListTableInner(props, ref) {
|
|
|
3794
3794
|
[columns, columnVisibility, columnOrders, columnConfig]
|
|
3795
3795
|
);
|
|
3796
3796
|
const resolvedRowHeight = densityOverride ?? rowHeight;
|
|
3797
|
-
const
|
|
3798
|
-
|
|
3797
|
+
const resolvedHeaderRowHeight = densityOverride ?? headerRowHeight;
|
|
3798
|
+
const resolvedSummaryRowHeight = densityOverride ?? summaryRowHeight;
|
|
3799
|
+
const options = useMemo(() => {
|
|
3800
|
+
const nextOptions = buildListTableOptions({
|
|
3799
3801
|
width,
|
|
3800
3802
|
height,
|
|
3801
3803
|
emptyText,
|
|
@@ -3812,8 +3814,8 @@ function ReactListTableInner(props, ref) {
|
|
|
3812
3814
|
contextMenu,
|
|
3813
3815
|
grouping,
|
|
3814
3816
|
rowHeight: resolvedRowHeight,
|
|
3815
|
-
headerRowHeight,
|
|
3816
|
-
summaryRowHeight,
|
|
3817
|
+
headerRowHeight: resolvedHeaderRowHeight,
|
|
3818
|
+
summaryRowHeight: resolvedSummaryRowHeight,
|
|
3817
3819
|
overscanRowCount,
|
|
3818
3820
|
query,
|
|
3819
3821
|
rowSelector,
|
|
@@ -3829,43 +3831,49 @@ function ReactListTableInner(props, ref) {
|
|
|
3829
3831
|
tableId,
|
|
3830
3832
|
rowDrag,
|
|
3831
3833
|
debug
|
|
3832
|
-
})
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3834
|
+
});
|
|
3835
|
+
return {
|
|
3836
|
+
...nextOptions,
|
|
3837
|
+
ui: {
|
|
3838
|
+
...nextOptions.ui,
|
|
3839
|
+
onDensityChange: setDensityOverride
|
|
3840
|
+
}
|
|
3841
|
+
};
|
|
3842
|
+
}, [
|
|
3843
|
+
width,
|
|
3844
|
+
height,
|
|
3845
|
+
emptyText,
|
|
3846
|
+
scroll,
|
|
3847
|
+
locale,
|
|
3848
|
+
onChange,
|
|
3849
|
+
rowKey,
|
|
3850
|
+
resolvedColumns,
|
|
3851
|
+
dataSource,
|
|
3852
|
+
onRow,
|
|
3853
|
+
theme,
|
|
3854
|
+
striped,
|
|
3855
|
+
highlightMode,
|
|
3856
|
+
contextMenu,
|
|
3857
|
+
grouping,
|
|
3858
|
+
resolvedRowHeight,
|
|
3859
|
+
resolvedHeaderRowHeight,
|
|
3860
|
+
resolvedSummaryRowHeight,
|
|
3861
|
+
overscanRowCount,
|
|
3862
|
+
query,
|
|
3863
|
+
rowSelector,
|
|
3864
|
+
rowSelection,
|
|
3865
|
+
expandable,
|
|
3866
|
+
pagination,
|
|
3867
|
+
scrollbar,
|
|
3868
|
+
carouselScroll,
|
|
3869
|
+
stretchColumns,
|
|
3870
|
+
resizable,
|
|
3871
|
+
storageKey,
|
|
3872
|
+
draggable,
|
|
3873
|
+
tableId,
|
|
3874
|
+
rowDrag,
|
|
3875
|
+
debug
|
|
3876
|
+
]);
|
|
3869
3877
|
const {
|
|
3870
3878
|
containerRef,
|
|
3871
3879
|
tableRef,
|
|
@@ -3922,10 +3930,11 @@ function ReactListTableInner(props, ref) {
|
|
|
3922
3930
|
title,
|
|
3923
3931
|
toolbar,
|
|
3924
3932
|
columns: resolvedColumns,
|
|
3925
|
-
density: resolvedRowHeight === "auto" ?
|
|
3933
|
+
density: resolvedRowHeight === "auto" ? 32 : resolvedRowHeight ?? 32,
|
|
3926
3934
|
hostRef: shellRef,
|
|
3927
3935
|
onExport: (options2) => tableRef.current?.exportXlsx(options2),
|
|
3928
3936
|
onDensityChange: (density) => {
|
|
3937
|
+
tableRef.current?.changeDensity(density);
|
|
3929
3938
|
setDensityOverride(density);
|
|
3930
3939
|
if (toolbar) {
|
|
3931
3940
|
toolbar.onDensityChange?.(density);
|