2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
|
|
|
'p-treetable p-component',
|
|
|
|
{
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-hoverable': props.rowHover || instance.rowSelectionMode,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-treetable-resizable': props.resizableColumns,
|
|
|
|
'p-treetable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit',
|
|
|
|
'p-treetable-scrollable': props.scrollable,
|
|
|
|
'p-treetable-flex-scrollable': props.scrollable && props.scrollHeight === 'flex',
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-gridlines': props.showGridlines,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-treetable-sm': props.size === 'small',
|
|
|
|
'p-treetable-lg': props.size === 'large'
|
|
|
|
}
|
|
|
|
],
|
2024-04-29 09:00:43 +00:00
|
|
|
loadingWrapper: 'p-treetable-loading', //TODO: required?
|
|
|
|
loadingOverlay: 'p-treetable-mask p-component-overlay',
|
2023-10-02 10:46:09 +00:00
|
|
|
loadingIcon: 'p-treetable-loading-icon',
|
|
|
|
header: 'p-treetable-header',
|
2024-04-29 09:00:43 +00:00
|
|
|
paginator: ({ position }) => 'p-treetable-paginator-' + position,
|
|
|
|
wrapper: 'p-treetable-table-container',
|
2023-10-02 10:46:09 +00:00
|
|
|
thead: 'p-treetable-thead',
|
2024-04-29 09:00:43 +00:00
|
|
|
headerCell: ({ instance, props }) => [
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-sortable-column': instance.columnProp('sortable'),
|
|
|
|
'p-treetable-resizable-column': props.resizableColumns,
|
|
|
|
'p-treetable-column-sorted': instance.isColumnSorted(),
|
|
|
|
'p-treetable-frozen-column': instance.columnProp('frozen')
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-29 09:00:43 +00:00
|
|
|
columnResizer: 'p-treetable-column-resizer',
|
|
|
|
headerTitle: 'p-treetable-column-title',
|
|
|
|
sortIcon: 'p-treetable-sort-icon',
|
|
|
|
sortBadge: 'p-treetable-sort-badge',
|
|
|
|
tbody: 'p-treetable-tbody',
|
|
|
|
row: ({ instance }) => [
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-row-selected': instance.selected
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-29 09:00:43 +00:00
|
|
|
bodyCell: ({ instance }) => [
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-frozen-column': instance.columnProp('frozen')
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-29 09:00:43 +00:00
|
|
|
rowToggler: 'p-treetable-row-toggle-button',
|
|
|
|
rowTogglerIcon: 'p-treetable-row-toggle-icon',
|
|
|
|
rowCheckbox: ({ instance }) => 'p-treetable-row-checkbox',
|
|
|
|
emptyMessage: 'p-treetable-empty-message',
|
2023-10-02 10:46:09 +00:00
|
|
|
tfoot: 'p-treetable-tfoot',
|
|
|
|
footerCell: ({ instance }) => [
|
|
|
|
{
|
2024-04-29 09:00:43 +00:00
|
|
|
'p-treetable-frozen-column': instance.columnProp('frozen')
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
//treetable
|
|
|
|
footer: 'p-treetable-footer',
|
2024-04-29 09:00:43 +00:00
|
|
|
resizeHelper: 'p-treetable-column-resize-indicator'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'treetable',
|
|
|
|
classes
|
|
|
|
});
|