lecom-ui 5.2.91 → 5.2.93
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.
|
@@ -113,8 +113,10 @@ function buildColumns({
|
|
|
113
113
|
width: externalColumn.width,
|
|
114
114
|
fixed: externalColumn.fixed,
|
|
115
115
|
truncate: !!externalColumn.truncate,
|
|
116
|
+
align: externalColumn.align,
|
|
116
117
|
headerClassName: externalColumn.headerClassName,
|
|
117
|
-
headerStyle: externalColumn.headerStyle
|
|
118
|
+
headerStyle: externalColumn.headerStyle,
|
|
119
|
+
cellClassName: externalColumn.cellClassName
|
|
118
120
|
},
|
|
119
121
|
sortingFn: (rowA, rowB, columnId) => {
|
|
120
122
|
if (externalColumn.onSortClient) {
|
|
@@ -19,11 +19,13 @@ function Table({
|
|
|
19
19
|
overflow: "hidden",
|
|
20
20
|
maxWidth: "0",
|
|
21
21
|
textOverflow: "ellipsis",
|
|
22
|
-
whiteSpace: "nowrap"
|
|
22
|
+
whiteSpace: "nowrap",
|
|
23
|
+
textAlign: meta.align || "left"
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
return {
|
|
26
|
-
width: meta.width
|
|
27
|
+
width: meta.width,
|
|
28
|
+
textAlign: meta.align || "left"
|
|
27
29
|
};
|
|
28
30
|
};
|
|
29
31
|
const getFixed = (meta) => meta.fixed;
|
|
@@ -51,10 +53,10 @@ function Table({
|
|
|
51
53
|
),
|
|
52
54
|
"data-header": header.id,
|
|
53
55
|
"data-fixed": getFixed(header.column.columnDef.meta),
|
|
54
|
-
style:
|
|
55
|
-
header.column.columnDef.meta,
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
style: {
|
|
57
|
+
...styleColumn(header.column.columnDef.meta, "th"),
|
|
58
|
+
...header.column.columnDef.meta?.headerStyle
|
|
59
|
+
},
|
|
58
60
|
onClick: header.column.getToggleSortingHandler()
|
|
59
61
|
},
|
|
60
62
|
header.isPlaceholder ? null : flexRender(
|
|
@@ -72,7 +74,10 @@ function Table({
|
|
|
72
74
|
"td",
|
|
73
75
|
{
|
|
74
76
|
key: cell.id,
|
|
75
|
-
className:
|
|
77
|
+
className: cn(
|
|
78
|
+
"p-4 py-0 h-10 [&:has([role=checkbox])]:pr-0 transition-colors shadow-[0_-0.5px_0px_0px_#c9c9c9_inset] text-left",
|
|
79
|
+
cell.column.columnDef.meta?.cellClassName
|
|
80
|
+
),
|
|
76
81
|
"data-column": cell.column.id,
|
|
77
82
|
"data-fixed": getFixed(cell.column.columnDef.meta),
|
|
78
83
|
style: styleColumn(cell.column.columnDef.meta, "td")
|
|
@@ -187,6 +187,7 @@ const Pagination = ({
|
|
|
187
187
|
activeColor,
|
|
188
188
|
showPerPageSelector = true
|
|
189
189
|
}) => {
|
|
190
|
+
const { t } = useTranslation();
|
|
190
191
|
const mapPaginationItem = (item) => {
|
|
191
192
|
const componentProps = {
|
|
192
193
|
onClick: item.onClick,
|
|
@@ -227,6 +228,7 @@ const Pagination = ({
|
|
|
227
228
|
totalRowsSelected
|
|
228
229
|
}
|
|
229
230
|
),
|
|
231
|
+
!showPerPageSelector && totalRowsSelected > 0 && /* @__PURE__ */ React.createElement(Typography, { variant: "heading-xxsmall-600", textColor: "text-grey-800" }, totalRowsSelected, " ", t("pagination.selectedProcess")),
|
|
230
232
|
/* @__PURE__ */ React.createElement("nav", { role: "navigation", "aria-label": "pagination" }, /* @__PURE__ */ React.createElement(PaginationContent, null, itemsPage.map((item) => /* @__PURE__ */ React.createElement(PaginationItem, { key: item.id }, mapPaginationItem(item)))))
|
|
231
233
|
);
|
|
232
234
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -473,8 +473,10 @@ interface Column<TData, TValue> {
|
|
|
473
473
|
width?: number | string;
|
|
474
474
|
fixed?: string;
|
|
475
475
|
truncate?: boolean;
|
|
476
|
+
align?: 'left' | 'center' | 'right';
|
|
476
477
|
headerClassName?: string;
|
|
477
478
|
headerStyle?: React.CSSProperties;
|
|
479
|
+
cellClassName?: string;
|
|
478
480
|
customHeaderRender?: ({ table, column, }: ColumnSort<TData, TValue>) => React.ReactNode;
|
|
479
481
|
render?: (({ value, row }: ColumnRender<TData, TValue>) => React.ReactNode) | React.ReactNode;
|
|
480
482
|
onSort?: ({ table, column }: ColumnSort<TData, TValue>) => void;
|
|
@@ -520,7 +522,15 @@ interface BuildCellSelect<TData, TValue> {
|
|
|
520
522
|
checkedCell: Column<TData, TValue>['checkedCell'];
|
|
521
523
|
onCheckedCellChange: Column<TData, TValue>['onCheckedCellChange'];
|
|
522
524
|
}
|
|
523
|
-
|
|
525
|
+
interface Meta {
|
|
526
|
+
width?: number | string;
|
|
527
|
+
fixed?: string;
|
|
528
|
+
truncate?: boolean;
|
|
529
|
+
align?: 'left' | 'center' | 'right';
|
|
530
|
+
headerClassName?: string;
|
|
531
|
+
headerStyle?: React.CSSProperties;
|
|
532
|
+
cellClassName?: string;
|
|
533
|
+
}
|
|
524
534
|
interface TableProps<TData, TValue> {
|
|
525
535
|
table: Table<TData>;
|
|
526
536
|
isLoading?: boolean;
|