@pallasoft/ps-table-components 1.5.1 → 1.6.0
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.
|
@@ -24,7 +24,9 @@ const PsTableCardList = ({ columns, emptyContent, expandedRowIds, footerColumns,
|
|
|
24
24
|
: undefined, role: onRowClick ? 'button' : undefined, tabIndex: onRowClick ? 0 : undefined, children: [isSelectable ? ((0, jsx_runtime_1.jsx)("div", { className: 'pt-0.5', onClick: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), children: (0, jsx_runtime_1.jsx)(ps_input_components_1.PsCheckbox, { isSelected: selectedIds.includes(rowId), label: `Select ${getRowLabel(row)}`, onChange: () => onToggleRow(rowId) }) })) : null, (0, jsx_runtime_1.jsxs)("div", { className: 'flex min-w-0 flex-1 flex-col gap-2', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex items-start justify-between gap-3', children: [(0, jsx_runtime_1.jsx)("div", { className: 'min-w-0 text-sm font-semibold text-ink', children: primary ? primary.render(row) : null }), trailing ? ((0, jsx_runtime_1.jsx)("div", { className: 'shrink-0 text-right text-sm font-semibold tabular-nums text-ink', children: trailing.render(row) })) : null] }), rest.length > 0 ? ((0, jsx_runtime_1.jsx)("dl", { className: 'grid grid-cols-2 gap-x-4 gap-y-1.5', children: rest
|
|
25
25
|
.map((column) => ({ column, value: column.render(row) }))
|
|
26
26
|
.filter(({ value }) => value !== null && value !== undefined && value !== '')
|
|
27
|
-
.map(({ column, value }) => ((0, jsx_runtime_1.jsxs)("div", { className: 'min-w-0', children: [(0, jsx_runtime_1.jsx)("dt", { className: 'text-[0.68rem] font-semibold uppercase tracking-[0.12em] text-ink/40', children: column.label }), (0, jsx_runtime_1.jsx)("dd", { className:
|
|
27
|
+
.map(({ column, value }) => ((0, jsx_runtime_1.jsxs)("div", { className: column.cardFullWidth ? 'col-span-2 min-w-0' : 'min-w-0', children: [(0, jsx_runtime_1.jsx)("dt", { className: 'text-[0.68rem] font-semibold uppercase tracking-[0.12em] text-ink/40', children: column.label }), (0, jsx_runtime_1.jsx)("dd", { className: column.cardFullWidth
|
|
28
|
+
? 'text-sm text-ink/80'
|
|
29
|
+
: 'truncate text-sm text-ink/80', children: value })] }, column.id))) })) : null] })] }), renderExpandedRow ? ((0, jsx_runtime_1.jsx)(ps_motion_components_1.PsCollapse, { isOpen: isExpanded, children: (0, jsx_runtime_1.jsx)("div", { className: 'border-t border-line bg-mist/40 px-4 py-4', children: renderExpandedRow(row) }) })) : null] }, rowId));
|
|
28
30
|
}), footerColumns.length > 0 ? ((0, jsx_runtime_1.jsx)("li", { className: 'grid grid-cols-2 gap-x-4 gap-y-1.5 bg-mist/50 px-4 py-3', children: footerColumns.map((column) => ((0, jsx_runtime_1.jsxs)("div", { className: 'min-w-0', children: [(0, jsx_runtime_1.jsx)("p", { className: 'text-[0.68rem] font-semibold uppercase tracking-[0.12em] text-ink/40', children: column.label }), (0, jsx_runtime_1.jsx)("p", { className: 'truncate text-sm font-semibold text-ink', children: column.footer })] }, column.id))) })) : null] }));
|
|
29
31
|
};
|
|
30
32
|
exports.PsTableCardList = PsTableCardList;
|
|
@@ -3,6 +3,7 @@ import type { PsTableColumnFilter } from './table-column-filter';
|
|
|
3
3
|
export interface PsTableColumn<RowData> {
|
|
4
4
|
align?: 'center' | 'left' | 'right';
|
|
5
5
|
canHide?: boolean;
|
|
6
|
+
cardFullWidth?: boolean;
|
|
6
7
|
filter?: PsTableColumnFilter<RowData>;
|
|
7
8
|
footer?: ReactNode;
|
|
8
9
|
hideOnCards?: boolean;
|