@paubox/ui 1.17.0 → 1.18.1
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/index.esm.js +8 -2
- package/package.json +1 -1
- package/src/lib/Table/Table.d.ts +2 -0
package/index.esm.js
CHANGED
|
@@ -30276,7 +30276,7 @@ var Pagination = function(param) {
|
|
|
30276
30276
|
/*#__PURE__*/ jsx(Typography, {
|
|
30277
30277
|
variant: "paragraph300Regular",
|
|
30278
30278
|
as: "span",
|
|
30279
|
-
children: pageInfo.pageCount
|
|
30279
|
+
children: formatNumber(pageInfo.pageCount)
|
|
30280
30280
|
})
|
|
30281
30281
|
]
|
|
30282
30282
|
}),
|
|
@@ -34848,7 +34848,9 @@ var TableHeader = function(param) {
|
|
|
34848
34848
|
];
|
|
34849
34849
|
var columnDef = header === null || header === void 0 ? void 0 : (_header_column = header.column) === null || _header_column === void 0 ? void 0 : _header_column.columnDef;
|
|
34850
34850
|
var autoWidth = !!columnDef.autoWidth;
|
|
34851
|
+
var align = columnDef.align;
|
|
34851
34852
|
var isFixed = actionHeaders.includes(header.id);
|
|
34853
|
+
var justifyContent = align === 'right' ? 'flex-end' : align === 'center' ? 'center' : undefined;
|
|
34852
34854
|
return /*#__PURE__*/ jsxs(Th, {
|
|
34853
34855
|
variant: "paragraph200Semibold",
|
|
34854
34856
|
as: "th",
|
|
@@ -34856,6 +34858,7 @@ var TableHeader = function(param) {
|
|
|
34856
34858
|
width: autoWidth ? 'auto' : "".concat(header.getSize(), "px"),
|
|
34857
34859
|
minWidth: isFixed ? "".concat(header.getSize(), "px") : autoWidth ? 'auto' : undefined,
|
|
34858
34860
|
maxWidth: isFixed ? "".concat(header.getSize(), "px") : autoWidth ? 'auto' : undefined,
|
|
34861
|
+
textAlign: align,
|
|
34859
34862
|
padding: dense ? "".concat(spacing(1), "px ").concat(spacing(header.id === 'row-select' ? 1 : 1.5), "px") : "".concat(spacing(1.5), "px ").concat(spacing(header.id === 'row-select' ? 1 : 1.5), "px")
|
|
34860
34863
|
},
|
|
34861
34864
|
children: [
|
|
@@ -34864,7 +34867,8 @@ var TableHeader = function(param) {
|
|
|
34864
34867
|
onClick: !disableControls ? header.column.getToggleSortingHandler() : undefined,
|
|
34865
34868
|
style: {
|
|
34866
34869
|
width: (actionHeaders === null || actionHeaders === void 0 ? void 0 : actionHeaders.includes(header === null || header === void 0 ? void 0 : header.id)) ? "".concat(header.getSize(), "px") : '100%',
|
|
34867
|
-
cursor: header.column.getCanSort() ? 'pointer' : 'default'
|
|
34870
|
+
cursor: header.column.getCanSort() ? 'pointer' : 'default',
|
|
34871
|
+
justifyContent: justifyContent
|
|
34868
34872
|
},
|
|
34869
34873
|
"data-testid": header.column.getCanSort() ? "".concat(testId, "-column-header-").concat(formatForId(header.id), "-sort-button") : undefined,
|
|
34870
34874
|
children: [
|
|
@@ -35051,6 +35055,7 @@ var TableBody = function(param) {
|
|
|
35051
35055
|
var overflow = columnDef.overflow;
|
|
35052
35056
|
var maxLines = columnDef.maxLines;
|
|
35053
35057
|
var autoWidth = columnDef.autoWidth;
|
|
35058
|
+
var align = columnDef.align;
|
|
35054
35059
|
var isFixed = cell.column.id === 'row-select' || cell.column.id === 'context';
|
|
35055
35060
|
var cellContent = flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
35056
35061
|
return /*#__PURE__*/ jsx(Td, {
|
|
@@ -35062,6 +35067,7 @@ var TableBody = function(param) {
|
|
|
35062
35067
|
width: autoWidth ? 'auto' : "".concat(cell.column.getSize(), "px"),
|
|
35063
35068
|
minWidth: isFixed ? "".concat(cell.column.getSize(), "px") : undefined,
|
|
35064
35069
|
maxWidth: isFixed ? "".concat(cell.column.getSize(), "px") : undefined,
|
|
35070
|
+
textAlign: align,
|
|
35065
35071
|
padding: dense ? "".concat(spacing(1), "px ").concat(spacing(cell.column.id === 'row-select' ? 1 : 1.5), "px") : "".concat(spacing(1.5), "px ").concat(spacing(cell.column.id === 'row-select' ? 1 : 1.5), "px")
|
|
35066
35072
|
},
|
|
35067
35073
|
children: overflow === 'clamp' && maxLines ? /*#__PURE__*/ jsx(ClampWrapper, {
|
package/package.json
CHANGED
package/src/lib/Table/Table.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { CSSProperties, HTMLProps, ReactNode } from 'react';
|
|
|
2
2
|
import { ColumnDef, OnChangeFn, Row } from '@tanstack/react-table';
|
|
3
3
|
import { PageInfoPageBased, PageInfoCursorBased } from '../Pagination/Pagination';
|
|
4
4
|
export type CellOverflow = 'truncate' | 'wrap' | 'clamp';
|
|
5
|
+
export type ColumnAlign = 'left' | 'right' | 'center';
|
|
5
6
|
export declare const TableContainer: import("@emotion/styled").StyledComponent<Omit<HTMLProps<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
6
7
|
theme?: import("@theme").Theme;
|
|
7
8
|
}, {}, {}>;
|
|
@@ -18,6 +19,7 @@ export type TableColumn<T> = ColumnDef<T> & {
|
|
|
18
19
|
autoWidth?: boolean;
|
|
19
20
|
overflow?: CellOverflow;
|
|
20
21
|
maxLines?: number;
|
|
22
|
+
align?: ColumnAlign;
|
|
21
23
|
};
|
|
22
24
|
export interface RowSelectState {
|
|
23
25
|
[x: string]: boolean;
|